home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 October: Technology Seed / ADC Seed CD - October 1999.toast / FireWire / FireWire_2.0_SDK / Interfaces / FireWire.h next >
Encoding:
Text File  |  1999-04-12  |  106.3 KB  |  3,329 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        FireWire.h
  3.  
  4.     Contains:    Definitions and interfaces for FireWire driver family.
  5.  
  6.     Version:    1.0
  7.  
  8.     Copyright:    © 1996-1999 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     File Ownership:
  11.  
  12.         DRI:                Eric Anderson
  13.  
  14.         Other Contact:        
  15.  
  16.         Technology:            FireWire
  17.  
  18.     Writers:
  19.  
  20.         (EA)    Eric Anderson (ewa)
  21.         (DCB)    Clinton Bauder
  22.         (ES)    Erik Staats
  23.         (jkl)    Jay Lloyd
  24.  
  25.     Change History (most recent first):
  26.  
  27.      <FW127>      3/8/99    EA        Added kFWAddressPhysical flag.
  28.      <FW126>     1/21/99    DCB        Add FWWaitForDeviceRePlug.
  29.      <FW125>     1/17/99    EA        Added FWCommandObjectID to FWClientPowerNotifyParamsStruct.
  30.      <FW124>      1/3/99    EA        Added speed to FWClientAsynchRequestParamsStruct so that clients
  31.                                     can learn and control the speeds of request/response packets, if
  32.                                     needed (for example, an SBP-2 target emulator).  Also added
  33.                                     kFWAsynchOverrideSpeed constant for asynch transfer flags.
  34.                                     Added prototypes of set/get speed functions.
  35.      <FW123>      1/3/99    EA        Put ; after new enum. D'oh.
  36.      <FW122>      1/3/99    EA        Added notificationEvent constants for cable power events.
  37.      <FW121>      1/3/99    EA        Added stuff for cable power management.
  38.      <FW120>     12/7/98    EA        Added prototype for FWInstallNewFWIM for CardBus.
  39.      <FW119>     9/20/98    EA        Added SBP-2 API selectors and command object types.
  40.      <FW118>      9/1/98    EA        Added FWAllocatePhysicalAddressSpace prototype.
  41.      <FW117>     8/24/98    EA        Added FWGetCycleTime prototype, and FWIM dispatch table entry.
  42.                                     Changed fwimPollInterruptsProcPtr to fwimPollInterruptsProc.
  43.      <FW116>      8/2/98    EA        Added selectors for SBP-2 notifications.
  44.      <FW115>     7/24/98    jkl        Changed gestalt hasPorts selector from 0 to 1. This selector is
  45.                                     for bit 0 in the FireWire gestalt attributes. Also updated
  46.                                     version for FSL.
  47.      <FW114>     7/24/98    DCB        Add some comments regarding SetFWIMState.
  48.      <FW113>     7/17/98    DCB        Added a new FWIM command -  FWIMSetFWIMState for sleeping or
  49.                                     quiescing FWIMs.
  50.      <FW112>      7/5/98    EA        Add param to FWIMSetCSRROMParamsStruct so that the CSR ROM can't
  51.                                     be read while it is being updated. Also added FWIM Features
  52.                                     flags and FWIMInitializeParams for feature flags and CSR ROM Map
  53.                                     length. Add more 1.1 FWIM API declarations.
  54.      <FW111>      7/1/98    EA        Add services for OpenHCI FWIMs.
  55.      <FW110>      6/9/98    jkl        Corrected PHY packet tCode to 0x0E, or 14, not 13.
  56.      <FW109>      6/5/98    jkl        Added PHY packet transmit tcode define.
  57.      <FW108>      6/5/98    jkl        Corrected AckBusy defines.
  58.      <FW107>     4/21/98    DCB        Adding some more stuff for self-id packets 1-3.
  59.      <FW106>      3/9/98    DCB        Fleshing out self-id packet definitions.
  60.        <105>     2/11/98    DCB        Adding FWIMEnableVMUserCode and FWIMDisableVMUserCode. This file
  61.                                     needs to be changed into a .i file so we can keep future APIs in
  62.                                     here where they belong without making life difficult for DDK
  63.                                     releases.
  64.        <104>     1/15/98    jkl        Update for new interfaces.
  65.        <103>    11/14/97    jkl        Add defines for FireWire Gestalt.
  66.      <FW102>     3/14/97    ES        Changed error code values to one's we've been allocated.
  67.      <FW101>      3/3/97    ES        Added DCLTimeStamp.
  68.      <FW100>     2/20/97    ES        Rearranged FWClientAsynchRequestParams, removed buffer, and
  69.                                     added receiveBuffer, transmitBuffer, and responseCode.
  70.       <FW99>     2/14/97    ES        Added FWIMFinalize and FWIMPollInterrupts to FWIM plug in
  71.                                     dispatch table.
  72.       <FW98>     2/14/97    ES        Moved transfer buffer packet size into the transfer buffer DCL
  73.                                     and removed the set packet size DCL.
  74.       <FW97>     2/14/97    ES        Added procedure prototype for FWModifyDCLList and added some
  75.                                     defs for DCL opcode flags.
  76.       <FW96>      2/6/97    ES        Removed some private fields from FWClientInterfaceParams.
  77.       <FW95>      2/6/97    ES        Removed some private fields from FWIMCommandParams record. Added
  78.                                     procedure prototypes for registering protocol drivers.
  79.       <FW94>      2/4/97    ES        Added private and initial unit address space allocation options
  80.                                     to FWAllocateAddressSpace. Added defs for initial memory,
  81.                                     private, and initial unit address spaces. Added support for
  82.                                     offset entries to FWCSRROMCreateEntry.
  83.       <FW93>     1/27/97    ES        Changed protocol driver file type to 'ndrv'. Fixes bug #1621930.
  84.       <FW92>     1/16/97    ES        Changed CSR ROM search key bit constant names. Added procedure
  85.                                     prototype for FWCSRROMDisposeEntry.
  86.       <FW91>      1/9/97    ES        Added includes so this file can compile by itself.
  87.       <FW90>      1/8/97    ES        Changed defs for kInvalidCSRROMEntryType and
  88.                                     kImmediateCSRROMEntryType. Added generation and sourceID fields
  89.                                     to FWClientAsynchRequestParams. Added procedure prototypes for
  90.                                     FWGetFWDeviceIDFromFWReferenceID, FWFindFWDeviceFromNodeID, and
  91.                                     FWGetUnitCSRROMEntryID.
  92.       <FW89>      1/1/97    ES        Added FWUpdateDCLList. Changed the DCL notification interface.
  93.                                     Changed DCL event defs to kFWDCL<Event>Event.
  94.       <FW88>    12/27/96    ES        Added a bunch of procedure prototypes.
  95.       <FW87>    12/27/96    ES        Changed a bunch of "FWDriver"s to "FWClient"s and added support
  96.                                     for protocol drivers, clients, and units.
  97.       <FW86>    12/26/96    ES        Added support for DCL program stop and release procs.
  98.       <FW85>    12/16/96    ES        Changed to work with new read/write/lock request/complete
  99.                                     processing mechanism.
  100.       <FW84>    12/26/96    ES        Consolidated some parameters in asynch FWIM commands and
  101.                                     processing.
  102.       <FW83>    12/22/96    ES        Changed IsochPortAction to IsochPortControl.
  103.       <FW82>    12/12/96    ES        Took transmit buffer out of FWIMProcessAsynchParams record.
  104.       <FW81>    12/11/96    ES        Removed some fields from FWIMProcessAsynchParams. Changed
  105.                                     FWIMProcess routines to return OSStatus.
  106.       <FW80>    12/10/96    ES        Added defs for isochronous channel force stop notification.
  107.       <FW79>     12/6/96    ES        Changed FWIMInstallParams to FWIMInitializeParams and changed
  108.                                     some of the fields in FWIMInitializeParams.
  109.                                     FWIMAsynchCommandParams were changed to supply the split
  110.                                     transaction timeout.
  111.       <FW78>     12/6/96    ES        Added FWClippedSubtract.
  112.       <FW77>     12/3/96    ES        Added kFWFixedAddress flag to FWAllocateAddressSpace.
  113.       <FW76>    11/27/96    ES        Added retryExceededErr.
  114.       <FW75>    11/26/96    ES        Added procedure prototype for FWStartDCLProgram.
  115.       <FW74>    11/11/96    ES        Added GetUniqueID FWIM command and FWDeallocateAddressSpace.
  116.       <FW73>     11/5/96    ES        Added stuff for FireWire deferred tasks.
  117.       <FW72>    10/18/96    ES        Added kDCLSendBufferOp and kDCLSetPacketSizeOp. Changed the
  118.                                     definition of DCL compiler notification procs. Added a number of
  119.                                     DCL procedure prototypes.
  120.       <FW71>    10/16/96    ES        Added stuff for bus management notification. Also, added
  121.                                     disconnectedErr.
  122.       <FW70>     10/4/96    ES        Added procedure prototype for FWCallDCLCallProc.
  123.       <FW69>     10/4/96    ES        Replaced DCLSetPacketAttributes command with DCLSetTagSyncBits
  124.                                     command. Added DCLSetPacketWithHeaderStart command.
  125.       <FW68>     10/3/96    ES        Added FWIMPluginDispatchTable stuff.
  126.       <FW67>     10/3/96    ES        Removed GetTopologyMap FWIM command. Made FWGetTopologyMap
  127.                                     immediate. Added FWProcessSelfIDs.
  128.       <FW66>     9/27/96    ES        Added procedure prototypes for routines to set and get driver
  129.                                     interface procs and removed driver interface table from
  130.                                     FWRegisterDriver.
  131.       <FW65>     9/26/96    ES        Added kFWAsynchFailOnBusReset.
  132.       <FW64>     9/26/96    ES        Added separateBusErr.
  133.       <FW63>     9/25/96    ES        Added kFWAsynchAbsoluteAddress.
  134.       <FW62>     9/25/96    ES        Added FWIM asynchronous transaction response commands. Changed
  135.                                     FWIMProcessAsynchParams record.
  136.       <FW61>     9/20/96    ES        Added kFWAsynchDisableAddressIncrement to allow disabling of
  137.                                     automatic address incrementing on asynchronous transfers.
  138.       <FW60>     9/16/96    ES        Changed FWIM and FireWire driver interfaces to return command
  139.                                     acceptance.
  140.       <FW59>     9/16/96    ES        Added response code field to FWIMProcessAsynchRequestParams.
  141.                                     Took out some unused constants and data structures.
  142.       <FW58>     9/16/96    ES        Fixed defs for kFWIsochTCode and kFWIsochTag.
  143.       <FW57>     9/11/96    ES        Changed maxRetries for FCP commands to be UInt32 instead of
  144.                                     SInt32.
  145.       <FW56>     9/11/96    ES        Added kFWMaxNodeHops, kFWTopologyMapMaxSelfIDs, and FWSpeedMap
  146.                                     defs. Added speed parameter to FWIMAsynchCommandParams.
  147.       <FW55>      9/5/96    ES        Added fwDriverAsynchRequestParams to FWIMProcessAsynchParams
  148.                                     record and changed completionProcData in FWIMProcessParams
  149.                                     record to a UInt32.
  150.       <FW54>      9/4/96    ES        Added procedure prototype for FWDeallocateIsochronousChannelID.
  151.       <FW53>      9/3/96    ES        Added driver reset notification.
  152.       <FW52>      9/3/96    ES        Added kFWIMSendLinkOnPacket.
  153.       <FW51>     8/30/96    ES        Added a bunch of stuff for isochronous resource management.
  154.       <FW50>     8/29/96    ES        Added set and clear contender bit FWIM commands.
  155.       <FW49>     8/29/96    ES        Changed FWRegisterDriver to take driver interface proc table.
  156.       <FW48>     8/28/96    ES        Added procedure prototypes for FWProcessLockRequest. Added def
  157.                                     for kFWDriverLock. Added extendedTCode to some asynch command
  158.                                     parameter records.
  159.       <FW47>     8/28/96    ES        Added kFWAsynchOverrideMaxPayload to asynch transfer flags.
  160.       <FW46>     8/26/96    ES        Put back kInvalidFWGenerationNumber.
  161.       <FW45>     8/26/96    ES        Changed to new command object interface.
  162.       <FW44>     8/26/96    ES        Added local node ID to FWIMGetTopologyMapParams record, added
  163.                                     FWGetLocalFWReferenceIDFromFWReferenceID, and changed some
  164.                                     constant names.
  165.       <FW43>     8/16/96    ES        Added immediate modes. Changed FWAllocateIsochPort to take
  166.                                     FWAllocateIsochPortParams.
  167.       <FW42>     8/15/96    ES        Added defs for queueing for FW driver commands. Added procedure
  168.                                     prototypes for dynamically changing destination of DCL jump
  169.                                     commands. Added defs for making isoch channel and port routines
  170.                                     asynchronous.
  171.       <FW41>      8/8/96    ES        Added FWTranslateDCLProgram.
  172.       <FW40>      8/2/96    ES        Replaced IsochBufferChains with DCLPrograms.
  173.       <FW39>     7/31/96    ES        Changed to implement new isochronous buffering architecture.
  174.       <FW38>      7/8/96    ES        Added support for isochronous transmission. Added FWClippedAdd.
  175.                                     Added IRM allocation option to FWAllocateIsochronousChannelID.
  176.       <FW37>     6/24/96    ES        Added FWCompareAndSwap.
  177.       <FW36>     6/20/96    ES        Made this look more like a .i generated interface.
  178.       <FW35>     6/14/96    ES        Added FWUnregisterDriver.
  179.       <FW34>     5/31/96    ES        Took out expert notification stuff and added some virtual device
  180.                                     defs.
  181.       <FW33>     4/29/96    ES        Cleaned up FWCSRROMCreateEntryID procedure prototype.
  182.       <FW32>     4/17/96    ES        Changed and added some procedure prototypes.
  183.       <FW31>     4/15/96    ES        Got rid of stuff for FWDriverInstall and added stuff for
  184.                                     FWRegisterDriver.
  185.       <FW30>      4/5/96    ES        Added a bunch of CSRROM service procedure prototypes.
  186.       <FW29>     3/29/96    ES        Moved some of the virtual device stuff here from the private
  187.                                     header.
  188.       <FW28>     3/25/96    ES        Added support for asynch request packet handling by drivers.
  189.       <FW27>     3/12/96    ES        Added FWVDeviceID.
  190.       <FW26>      3/8/96    ES        Add stuff for creating CSR configuration ROM entries on the
  191.                                     local host.
  192.       <FW25>      3/7/96    ES        Changed stuff with address spaces and FWIM processing requests.
  193.       <FW24>     2/22/96    ES        Added stuff for FWIsochResourceManagerID.
  194.       <FW23>     2/21/96    ES        Added fwimData to IsochChannelBufferStruct, changed fwimData to
  195.                                     a UInt32 in IsochBufferChainStruct, and added isochChannelID to
  196.                                     FWDriverIsochPortParamsStruct.
  197.       <FW22>     2/21/96    ES        Added a bunch of atomic operations.
  198.       <FW21>     2/16/96    ES        Added procedure prototypes for FWAllocateIsochBufferChainID and
  199.                                     FWDeallocateIsochBufferChainID and changed some stuff for
  200.                                     isochronous ports.
  201.       <FW20>      2/9/96    ES        Added stuff for FWGetTopologyMap and for synchronizing the
  202.                                     services queue.
  203.       <FW19>      2/7/96    ES        Added kInvalidNodeID.
  204.       <FW18>      2/7/96    ES        Added FWThresholdAdd and FWThresholdSubtract and a whole bunch
  205.                                     of other stuff for doing lock transactions.
  206.       <FW17>      2/2/96    ES        Added stuff for disabling the FWIM command queue and specifying
  207.                                     the bus generation number in FireWire asynch commands.
  208.       <FW16>      2/1/96    ES        Added kFWIMCommandPriorityFlag, kFWInterfacePriorityFlag, and
  209.                                     busReconfiguredErr.
  210.       <FW15>     1/30/96    ES        Added stuff for doing bus resets.
  211.       <FW14>     1/30/96    ES        Defined kFWRequestWaiting and changed pNextFWInterfaceParams in
  212.                                     FWInterfaceParamsStruct from FWInterfaceParamsPtr * to
  213.                                     FWInterfaceParamsPtr.
  214.       <FW13>     1/26/96    ES        Added FWSetMaxPayloadSize and other maxPayload stuff.
  215.       <FW12>     1/24/96    ES        Added responseHandler and settable timeout to FCP command
  216.                                     params.
  217.       <FW11>     1/18/96    ES        Added function prototypes for task and software interrupt
  218.                                     services. Changed kMaxSelfIDPacketsPerNode to 9.
  219.       <FW10>     1/12/96    ES        Added FWReleaseIsochronousChannel and
  220.                                     FWReleaseLocalIsochronousPort. Changed kFWInvalidFWIMCommandID
  221.                                     to kInvalidFWIMCommandID.
  222.        <FW9>     1/12/96    ES        Added flags to FWIMCommandParams.
  223.        <FW8>     1/11/96    ES        Changed request and interface to command in most of the FWIM
  224.                                     stuff.
  225.        <FW7>     1/11/96    ES        Changed calling parameters for FWCommandIsComplete and changed
  226.                                     to FWIMCommandIsComplete. Added stuff for FWIMCommandIDs.
  227.        <FW6>     1/10/96    ES        Added prototype for FWProcessBusReset.
  228.        <FW5>      1/9/96    ES        Added FWProcessWriteRequest and removed kFWWriteNotify.
  229.        <FW4>      1/9/96    ES        Really got rid of kFWFWIMRequestCompleteNotify.
  230.        <FW3>      1/9/96    ES        Added FWCommandIsComplete. Removed kFWFWIMRequestCompleteNotify.
  231.        <FW2>      1/6/96    ES        Fill in contains and written by fields.
  232.        <FW1>      1/6/96    ES        first checked in
  233.  
  234. */
  235.  
  236. #ifndef __FIREWIRE__
  237. #define __FIREWIRE__
  238.  
  239. #ifndef __TYPES__
  240. #include <Types.h>
  241. #endif
  242.  
  243. #ifndef __DRIVERSERVICES__
  244. #include <DriverServices.h>
  245. #endif
  246.  
  247. #ifdef __cplusplus
  248. extern "C" {
  249. #endif
  250.  
  251. #if PRAGMA_IMPORT_SUPPORTED
  252. #pragma import on
  253. #endif
  254.  
  255. #if PRAGMA_ALIGN_SUPPORTED
  256. #pragma options align=mac68k
  257. #endif
  258.  
  259.  
  260. // Generic bit defs.
  261.  
  262. enum
  263. {
  264.     kBit0                        = (1 << 0),
  265.     kBit1                        = (1 << 1),
  266.     kBit2                        = (1 << 2),
  267.     kBit3                        = (1 << 3),
  268.     kBit4                        = (1 << 4),
  269.     kBit5                        = (1 << 5),
  270.     kBit6                        = (1 << 6),
  271.     kBit7                        = (1 << 7),
  272.     kBit8                        = (1 << 8),
  273.     kBit9                        = (1 << 9),
  274.     kBit10                        = (1 << 10),
  275.     kBit11                        = (1 << 11),
  276.     kBit12                        = (1 << 12),
  277.     kBit13                        = (1 << 13),
  278.     kBit14                        = (1 << 14),
  279.     kBit15                        = (1 << 15),
  280.     kBit16                        = (1 << 16),
  281.     kBit17                        = (1 << 17),
  282.     kBit18                        = (1 << 18),
  283.     kBit19                        = (1 << 19),
  284.     kBit20                        = (1 << 20),
  285.     kBit21                        = (1 << 21),
  286.     kBit22                        = (1 << 22),
  287.     kBit23                        = (1 << 23),
  288.     kBit24                        = (1 << 24),
  289.     kBit25                        = (1 << 25),
  290.     kBit26                        = (1 << 26),
  291.     kBit27                        = (1 << 27),
  292.     kBit28                        = (1 << 28),
  293.     kBit29                        = (1 << 29),
  294.     kBit30                        = (1 << 30),
  295.     kBit31                        = (1 << 31)
  296. };
  297.  
  298. #define BitRange(start, end)                        \
  299. (                                                    \
  300.     ((((UInt32) 0xFFFFFFFF) << (31 - (end))) >>        \
  301.      ((31 - (end)) + (start))) <<                    \
  302.     (start)                                            \
  303. )
  304.  
  305. #define BitRangePhase(start, end)                    \
  306.     (start)
  307.  
  308.  
  309. ////////////////////////////////////////////////////////////////////////////////
  310. //
  311. // Standard FireWire defs.
  312. //
  313.  
  314. // FireWire bit defs.
  315.  
  316. enum
  317. {
  318.     kFWBit0                        = (1 << 31),
  319.     kFWBit1                        = (1 << 30),
  320.     kFWBit2                        = (1 << 29),
  321.     kFWBit3                        = (1 << 28),
  322.     kFWBit4                        = (1 << 27),
  323.     kFWBit5                        = (1 << 26),
  324.     kFWBit6                        = (1 << 25),
  325.     kFWBit7                        = (1 << 24),
  326.     kFWBit8                        = (1 << 23),
  327.     kFWBit9                        = (1 << 22),
  328.     kFWBit10                    = (1 << 21),
  329.     kFWBit11                    = (1 << 20),
  330.     kFWBit12                    = (1 << 19),
  331.     kFWBit13                    = (1 << 18),
  332.     kFWBit14                    = (1 << 17),
  333.     kFWBit15                    = (1 << 16),
  334.     kFWBit16                    = (1 << 15),
  335.     kFWBit17                    = (1 << 14),
  336.     kFWBit18                    = (1 << 13),
  337.     kFWBit19                    = (1 << 12),
  338.     kFWBit20                    = (1 << 11),
  339.     kFWBit21                    = (1 << 10),
  340.     kFWBit22                    = (1 << 9),
  341.     kFWBit23                    = (1 << 8),
  342.     kFWBit24                    = (1 << 7),
  343.     kFWBit25                    = (1 << 6),
  344.     kFWBit26                    = (1 << 5),
  345.     kFWBit27                    = (1 << 4),
  346.     kFWBit28                    = (1 << 3),
  347.     kFWBit29                    = (1 << 2),
  348.     kFWBit30                    = (1 << 1),
  349.     kFWBit31                    = (1 << 0)
  350. };
  351.  
  352. #define FWBitRange(start, end)                        \
  353. (                                                    \
  354.     ((((UInt32) 0xFFFFFFFF) << (start)) >>            \
  355.      ((start) + (31 - (end)))) <<                    \
  356.     (31 - (end))                                    \
  357. )
  358.  
  359. #define FWBitRangePhase(start, end)                    \
  360.     (31 - end)
  361.  
  362.  
  363. /*zzz Put in IEEE1212.h */
  364. ////////////////////////////////////////////////////////////////////////////////
  365. //
  366. // Define some CSR stuff.
  367. //
  368.  
  369. // CSR bit defs.
  370.  
  371. enum
  372. {
  373.     kCSRBit0                    = (1 << 31),
  374.     kCSRBit1                    = (1 << 30),
  375.     kCSRBit2                    = (1 << 29),
  376.     kCSRBit3                    = (1 << 28),
  377.     kCSRBit4                    = (1 << 27),
  378.     kCSRBit5                    = (1 << 26),
  379.     kCSRBit6                    = (1 << 25),
  380.     kCSRBit7                    = (1 << 24),
  381.     kCSRBit8                    = (1 << 23),
  382.     kCSRBit9                    = (1 << 22),
  383.     kCSRBit10                    = (1 << 21),
  384.     kCSRBit11                    = (1 << 20),
  385.     kCSRBit12                    = (1 << 19),
  386.     kCSRBit13                    = (1 << 18),
  387.     kCSRBit14                    = (1 << 17),
  388.     kCSRBit15                    = (1 << 16),
  389.     kCSRBit16                    = (1 << 15),
  390.     kCSRBit17                    = (1 << 14),
  391.     kCSRBit18                    = (1 << 13),
  392.     kCSRBit19                    = (1 << 12),
  393.     kCSRBit20                    = (1 << 11),
  394.     kCSRBit21                    = (1 << 10),
  395.     kCSRBit22                    = (1 << 9),
  396.     kCSRBit23                    = (1 << 8),
  397.     kCSRBit24                    = (1 << 7),
  398.     kCSRBit25                    = (1 << 6),
  399.     kCSRBit26                    = (1 << 5),
  400.     kCSRBit27                    = (1 << 4),
  401.     kCSRBit28                    = (1 << 3),
  402.     kCSRBit29                    = (1 << 2),
  403.     kCSRBit30                    = (1 << 1),
  404.     kCSRBit31                    = (1 << 0)
  405. };
  406.  
  407. #define CSRBitRange(start, end)                        \
  408. (                                                    \
  409.     ((((UInt32) 0xFFFFFFFF) << (start)) >>            \
  410.      ((start) + (31 - (end)))) <<                    \
  411.     (31 - (end))                                    \
  412. )
  413.  
  414. #define CSRBitRangePhase(start, end)                \
  415.     (31 - end)
  416.  
  417. // Core CSR registers.
  418.  
  419. enum
  420. {
  421.     kCSRStateUnitDepend            = CSRBitRange (0, 15),
  422.     kCSRStateUnitDependPhase    = CSRBitRangePhase (0, 15),
  423.  
  424.     kCSRStateBusDepend            = CSRBitRange (16, 23),
  425.     kCSRStateBusDependPhase        = CSRBitRangePhase (16, 23),
  426.  
  427.     kCSRStateLost                = kCSRBit24,
  428.     kCSRStateDReq                = kCSRBit25,
  429.     kCSRStateELog                = kCSRBit27,
  430.     kCSRStateAtn                = kCSRBit28,
  431.     kCSRStateOff                = kCSRBit29,
  432.  
  433.     kCSRStateState                = CSRBitRange (30, 31),
  434.     kCSRStateStatePhase            = CSRBitRangePhase (30, 31),
  435.     kCSRStateStateRunning        = 0,
  436.     kCSRStateStateInitializing    = 1,
  437.     kCSRStateStateTesting        = 2,
  438.     kCSRStateStateDead            = 3
  439. };
  440.  
  441. // Key values.
  442.  
  443. enum
  444. {
  445.     kCSRTextualDescriptorKey    = 0x01,
  446.     kCSRBusDependentInfoKey        = 0x02,
  447.     kCSRModuleVendorIDKey        = 0x03,
  448.     kCSRModuleHwVersionKey        = 0x04,
  449.     kCSRModuleSpecIdKey            = 0x05,
  450.     kCSRModuleSwVersionKey        = 0x06,
  451.     kCSRModuleDependentInfoKey    = 0x07,
  452.     kCSRNodeVendorIdKey            = 0x08,
  453.     kCSRNodeHwVersionKey        = 0x09,
  454.     kCSRNodeSpecIdKey            = 0x0A,
  455.     kCSRNodeSwVersionKey        = 0x0B,
  456.     kCSRNodeCapabilitiesKey        = 0x0C,
  457.     kCSRNodeUniqueIdKey            = 0x0D,
  458.     kCSRNodeUnitsExtentKey        = 0x0E,
  459.     kCSRNodeMemoryExtentKey        = 0x0F,
  460.     kCSRNodeDependentInfoKey    = 0x10,
  461.     kCSRUnitDirectoryKey        = 0x11,
  462.     kCSRUnitSpecIdKey            = 0x12,
  463.     kCSRUnitSwVersionKey        = 0x13,
  464.     kCSRUnitDependentInfoKey    = 0x14,
  465.     kCSRUnitLocationKey            = 0x15,
  466.     kCSRUnitPollMaskKey            = 0x16
  467. };
  468.  
  469.  
  470. // Key value bits for searching.
  471.  
  472. enum
  473. {
  474.     kCSREveryKey                = 0xFFFFFFFF,
  475.  
  476.     kCSRTextualDescriptorKeyLoBit    = (1 << kCSRTextualDescriptorKey),
  477.     kCSRTextualDescriptorKeyHiBit    = 0,
  478.     kCSRBusDependentInfoKeyLoBit    = (1 << kCSRBusDependentInfoKey),
  479.     kCSRBusDependentInfoKeyHiBit    = 0,
  480.     kCSRModuleVendorIDKeyLoBit        = (1 << kCSRModuleVendorIDKey),
  481.     kCSRModuleVendorIDKeyHiBit        = 0,
  482.     kCSRModuleHwVersionKeyLoBit        = (1 << kCSRModuleHwVersionKey),
  483.     kCSRModuleHwVersionKeyHiBit        = 0,
  484.     kCSRModuleSpecIdKeyLoBit        = (1 << kCSRModuleSpecIdKey),
  485.     kCSRModuleSpecIdKeyHiBit        = 0,
  486.     kCSRModuleSwVersionKeyLoBit        = (1 << kCSRModuleSwVersionKey),
  487.     kCSRModuleSwVersionKeyHiBit        = 0,
  488.     kCSRModuleDependentInfoKeyLoBit    = (1 << kCSRModuleDependentInfoKey),
  489.     kCSRModuleDependentInfoKeyHiBit    = 0,
  490.     kCSRNodeVendorIdKeyLoBit        = (1 << kCSRNodeVendorIdKey),
  491.     kCSRNodeVendorIdKeyHiBit        = 0,
  492.     kCSRNodeHwVersionKeyLoBit        = (1 << kCSRNodeHwVersionKey),
  493.     kCSRNodeHwVersionKeyHiBit        = 0,
  494.     kCSRNodeSpecIdKeyLoBit            = (1 << kCSRNodeSpecIdKey),
  495.     kCSRNodeSpecIdKeyHiBit            = 0,
  496.     kCSRNodeSwVersionKeyLoBit        = (1 << kCSRNodeSwVersionKey),
  497.     kCSRNodeSwVersionKeyHiBit        = 0,
  498.     kCSRNodeCapabilitiesKeyLoBit    = (1 << kCSRNodeCapabilitiesKey),
  499.     kCSRNodeCapabilitiesKeyHiBit    = 0,
  500.     kCSRNodeUniqueIdKeyLoBit        = (1 << kCSRNodeUniqueIdKey),
  501.     kCSRNodeUniqueIdKeyHiBit        = 0,
  502.     kCSRNodeUnitsExtentKeyLoBit        = (1 << kCSRNodeUnitsExtentKey),
  503.     kCSRNodeUnitsExtentKeyHiBit        = 0,
  504.     kCSRNodeMemoryExtentKeyLoBit    = (1 << kCSRNodeMemoryExtentKey),
  505.     kCSRNodeMemoryExtentKeyHiBit    = 0,
  506.     kCSRNodeDependentInfoKeyLoBit    = (1 << kCSRNodeDependentInfoKey),
  507.     kCSRNodeDependentInfoKeyHiBit    = 0,
  508.     kCSRUnitDirectoryKeyLoBit        = (1 << kCSRUnitDirectoryKey),
  509.     kCSRUnitDirectoryKeyHiBit        = 0,
  510.     kCSRUnitSpecIdKeyLoBit            = (1 << kCSRUnitSpecIdKey),
  511.     kCSRUnitSpecIdKeyHiBit            = 0,
  512.     kCSRUnitSwVersionKeyLoBit        = (1 << kCSRUnitSwVersionKey),
  513.     kCSRUnitSwVersionKeyHiBit        = 0,
  514.     kCSRUnitDependentInfoKeyLoBit    = (1 << kCSRUnitDependentInfoKey),
  515.     kCSRUnitDependentInfoKeyHiBit    = 0,
  516.     kCSRUnitLocationKeyLoBit        = (1 << kCSRUnitLocationKey),
  517.     kCSRUnitLocationKeyHiBit        = 0,
  518.     kCSRUnitPollMaskKeyLoBit        = (1 << kCSRUnitPollMaskKey),
  519.     kCSRUnitPollMaskKeyHiBit        = 0
  520. };
  521.  
  522.  
  523. // Key types.
  524.  
  525. enum
  526. {
  527.     kCSRImmediateKeyType        = 0,
  528.     kCSROffsetKeyType            = 1,
  529.     kCSRLeafKeyType                = 2,
  530.     kCSRDirectoryKeyType        = 3
  531. };
  532.  
  533.  
  534. // Key type bits for searching.
  535.  
  536. enum
  537. {
  538.     kCSREveryKeyType            = 0xFFFFFFFF,
  539.  
  540.     kCSRImmediateKeyTypeBit        = (1 << kCSRImmediateKeyType),
  541.     kCSROffsetKeyTypeBit        = (1 << kCSROffsetKeyType),
  542.     kCSRLeafKeyTypeBit            = (1 << kCSRLeafKeyType),
  543.     kCSRDirectoryKeyTypeBit        = (1 << kCSRDirectoryKeyType)
  544. };
  545.  
  546. // CSR ROM entry bit locations.
  547.  
  548. enum
  549. {
  550.     kCSRBusInfoBlockLength        = CSRBitRange (0, 7),
  551.     kCSRBusInfoBlockLengthPhase    = CSRBitRangePhase (0, 7),
  552.  
  553.     kCSRROMCRCLength            = CSRBitRange (8, 15),
  554.     kCSRROMCRCLengthPhase        = CSRBitRangePhase (8, 15),
  555.  
  556.     kCSRROMCRCValue                = CSRBitRange (16, 31),
  557.     kCSRROMCRCValuePhase        = CSRBitRangePhase (16, 31),
  558.  
  559.     kCSREntryKeyType            = CSRBitRange (0, 1),
  560.     kCSREntryKeyTypePhase        = CSRBitRangePhase (0, 1),
  561.  
  562.     kCSREntryKeyValue            = CSRBitRange (2, 7),
  563.     kCSREntryKeyValuePhase        = CSRBitRangePhase (2, 7),
  564.  
  565.     kCSREntryValue                = CSRBitRange (8, 31),
  566.     kCSREntryValuePhase            = CSRBitRangePhase (8, 31),
  567.  
  568.     kCSRLeafDirLength            = CSRBitRange (0, 15),
  569.     kCSRLeafDirLengthPhase        = CSRBitRangePhase (0, 15),
  570.  
  571.     kCSRLeafDirCRC                = CSRBitRange (16, 31),
  572.     kCSRLeafDirCRCPhase            = CSRBitRangePhase (16, 31)
  573. };
  574.  
  575. // CSR 64-bit fixed address defs.
  576.  
  577. enum
  578. {
  579.     kCSRNodeID                    = CSRBitRange (0, 15),
  580.     kCSRNodeIDPhase                = CSRBitRangePhase (0, 15),
  581.  
  582.     kCSRInitialMemorySpaceBaseAddressHi
  583.                                 = 0x00000000,
  584.     kCSRInitialMemorySpaceBaseAddressLo
  585.                                 = 0x00000000,
  586.  
  587.     kCSRPrivateSpaceBaseAddressHi
  588.                                 = 0x0000FFFF,
  589.     kCSRPrivateSpaceBaseAddressLo
  590.                                 = 0xE0000000,
  591.  
  592.     kCSRRegisterSpaceBaseAddressHi
  593.                                 = 0x0000FFFF,
  594.     kCSRRegisterSpaceBaseAddressLo
  595.                                 = 0xF0000000,
  596.  
  597.     kCSRCoreRegistersBaseAddress
  598.                                 = kCSRRegisterSpaceBaseAddressLo,
  599.     kCSRStateClearAddress        = kCSRCoreRegistersBaseAddress + 0x0000,
  600.     kCSRStateSetAddress            = kCSRCoreRegistersBaseAddress + 0x0004,
  601.     kCSRNodeIDsAddress            = kCSRCoreRegistersBaseAddress + 0x0008,
  602.     kCSRResetStartAddress        = kCSRCoreRegistersBaseAddress + 0x000C,
  603.     kCSRIndirectAddressAddress    = kCSRCoreRegistersBaseAddress + 0x0010,
  604.     kCSRIndirectDataAddress        = kCSRCoreRegistersBaseAddress + 0x0014,
  605.     kCSRSplitTimeoutHiAddress    = kCSRCoreRegistersBaseAddress + 0x0018,
  606.     kCSRSplitTimeoutLoAddress    = kCSRCoreRegistersBaseAddress + 0x001C,
  607.     kCSRArgumentHiAddress        = kCSRCoreRegistersBaseAddress + 0x0020,
  608.     kCSRArgumentLoAddress        = kCSRCoreRegistersBaseAddress + 0x0024,
  609.     kCSRTestStartAddress        = kCSRCoreRegistersBaseAddress + 0x0028,
  610.     kCSRTestStatusAddress        = kCSRCoreRegistersBaseAddress + 0x002C,
  611.     kCSRUnitsBaseHiAddress        = kCSRCoreRegistersBaseAddress + 0x0030,
  612.     kCSRUnitsBaseLoAddress        = kCSRCoreRegistersBaseAddress + 0x0034,
  613.     kCSRUnitsBoundHiAddress        = kCSRCoreRegistersBaseAddress + 0x0038,
  614.     kCSRUnitsBoundLoAddress        = kCSRCoreRegistersBaseAddress + 0x003C,
  615.     kCSRMemoryBaseHiAddress        = kCSRCoreRegistersBaseAddress + 0x0040,
  616.     kCSRMemoryBaseLoAddress        = kCSRCoreRegistersBaseAddress + 0x0044,
  617.     kCSRMemoryBoundHiAddress    = kCSRCoreRegistersBaseAddress + 0x0048,
  618.     kCSRMemoryBoundLoAddress    = kCSRCoreRegistersBaseAddress + 0x004C,
  619.     kCSRInterruptTargetAddress    = kCSRCoreRegistersBaseAddress + 0x0050,
  620.     kCSRInterruptMaskAddress    = kCSRCoreRegistersBaseAddress + 0x0054,
  621.     kCSRClockValueHiAddress        = kCSRCoreRegistersBaseAddress + 0x0058,
  622.     kCSRClockValueMidAddress    = kCSRCoreRegistersBaseAddress + 0x005C,
  623.     kCSRClockTickPeriodMidAddress
  624.                                 = kCSRCoreRegistersBaseAddress + 0x0060,
  625.     kCSRClockTickPeriodLoAddress
  626.                                 = kCSRCoreRegistersBaseAddress + 0x0064,
  627.     kCSRClockStrobeArrivedHiAddress
  628.                                 = kCSRCoreRegistersBaseAddress + 0x0068,
  629.     kCSRClockStrobeArrivedMidAddress
  630.                                 = kCSRCoreRegistersBaseAddress + 0x006C,
  631.     kCSRClockInfo0Address        = kCSRCoreRegistersBaseAddress + 0x0070,
  632.     kCSRClockInfo1Address        = kCSRCoreRegistersBaseAddress + 0x0074,
  633.     kCSRClockInfo2Address        = kCSRCoreRegistersBaseAddress + 0x0078,
  634.     kCSRClockInfo3Address        = kCSRCoreRegistersBaseAddress + 0x007C,
  635.     kCSRMessageRequestAddress    = kCSRCoreRegistersBaseAddress + 0x0080,
  636.     kCSRMessageResponseAddress    = kCSRCoreRegistersBaseAddress + 0x00C0,
  637.     kCSRErrorLogBufferAddress    = kCSRCoreRegistersBaseAddress + 0x0180,
  638.  
  639.     kCSRBusDependentRegistersBaseAddress
  640.                                 = kCSRRegisterSpaceBaseAddressLo + 0x0200,
  641.  
  642.     kCSRROMBaseAddress            = kCSRRegisterSpaceBaseAddressLo + 0x0400,
  643.     kCSRBIBHeaderAddress        = kCSRROMBaseAddress,
  644.     kCSRBIBBusNameAddress        = kCSRROMBaseAddress + 4
  645. };
  646.  
  647.  
  648. // CSR ROM search data types and structures.
  649.  
  650. enum {
  651. /*
  652.     ** Absolute locations
  653.     */
  654.     kIterateRoot                = 0x2L,
  655. /*
  656.     ** "Upward" Relationships    
  657.     */
  658.     kIterateParents                = 0x3L,                            /* include all  parent(s) of entry */
  659. /*
  660.     ** "Downward" Relationships
  661.     //
  662.     */
  663.     kIterateChildren            = 0x4L,                            /* include all children */
  664.     kIterateSubTrees            = 0x5L,                            /* include all sub trees of entry */
  665.     kIterateDescendants            = 0x5L,                            /* include all descendants of entry */
  666. /*
  667.     ** "Horizontal" Relationships    
  668.     */
  669.     kIterateSibling                = 0x6L,                            /* include all siblings */
  670. /*
  671.     ** Keep doing the same thing
  672.     */
  673.     kIterateContinue            = 0x1L
  674. };
  675.  
  676. enum
  677. {
  678.     kInvalidCSRROMIterator        = 0
  679. };
  680.  
  681. enum
  682. {
  683.     kCSRROMSearchForKey            = 1
  684. };
  685.  
  686. enum
  687. {
  688.     kInvalidCSRROMEntryType        = 0xFFFFFFFF,
  689.     kImmediateCSRROMEntryType    = 0,
  690.     kOffsetCSRROMEntryType        = 1,
  691.     kLeafCSRROMEntryType        = 2,
  692.     kDirectoryCSRROMEntryType    = 3
  693. };
  694.  
  695. enum
  696. {
  697.     kInvalidCSRROMEntryID        = 0                        // zzz should use generic invalid ID
  698. };
  699.  
  700. // CSR defined 64 bit unique ID.
  701.  
  702. struct CSRNodeUniqueIDStruct
  703. {
  704.     UInt32                        hi,
  705.                                 lo;                        // Hi and lo values of 64 bit unique ID.
  706. };
  707. typedef struct CSRNodeUniqueIDStruct
  708.                                 CSRNodeUniqueID,
  709.                                 *CSRNodeUniqueIDPtr;
  710.  
  711. typedef UInt32                    CSRROMEntryIterator;
  712. typedef UInt32                    CSRROMIterationOp;
  713. typedef struct OpaqueCSRROMEntryID*        CSRROMEntryID;
  714.  
  715. struct CSRROMSearchCriteriaStruct
  716. {
  717.     UInt32                        csrROMSearchType;        // Type of search record.
  718.     UInt32                        keyType;                // Key types to search for.
  719.     UInt32                        keyHi,                    // Key values to search for.
  720.                                 keyLo;                    //zzz ought to provide nice way to set these.
  721. };
  722. typedef struct CSRROMSearchCriteriaStruct
  723.                                 CSRROMSearchCriteria,
  724.                                 *CSRROMSearchCriteriaPtr;
  725.  
  726. /*zzz End put in IEEE1212.h */
  727.  
  728.  
  729. ////////////////////////////////////////////////////////////////////////////////
  730. //
  731. // FireWire CSR defs.
  732. //
  733.  
  734. // FireWire core CSR registers.
  735.  
  736. enum
  737. {
  738.     kFWCSRStateGone                = kFWBit16,
  739.     kFWCSRStateLinkOff            = kFWBit22,
  740.     kFWCSRStateCMstr            = kFWBit23
  741. };
  742.  
  743. // FireWire bus/nodeID address defs.
  744.  
  745. enum
  746. {
  747.     kFWAddressBusID                = FWBitRange (16, 25) << kCSRNodeIDPhase,
  748.     kFWAddressBusIDPhase        = FWBitRangePhase (16, 25) + kCSRNodeIDPhase,
  749.  
  750.     kFWAddressNodeID            = FWBitRange (26, 31) << kCSRNodeIDPhase,
  751.     kFWAddressNodeIDPhase        = FWBitRangePhase (26, 31) + kCSRNodeIDPhase,
  752.  
  753.     kFWLocalBusID                = 1023,
  754.     kFWBroadcastNodeID            = 63,
  755.  
  756.     kFWLocalBusAddress            = kFWLocalBusID << kFWAddressBusIDPhase,
  757.     kFWBroadcastAddress            = kFWBroadcastNodeID << kFWAddressNodeIDPhase
  758. };
  759.  
  760. #define FWNodeBaseAddress(busID, nodeID)                                                \
  761. (                                                                                        \
  762.     (busID << kFWAddressBusIDPhase) |                                                    \
  763.     (nodeID << kFWAddressNodeIDPhase)                                                    \
  764. )
  765.  
  766. #define FWNodeRegisterSpaceBaseAddressHi(busID, nodeID)                                    \
  767. (                                                                                        \
  768.     FWNodeBaseAddress (busID, nodeID) |                                                    \
  769.     kCSRRegisterSpaceBaseAddressHi                                                        \
  770. )
  771.  
  772.  
  773. // FireWire CSR bus info block defs.
  774.  
  775. enum
  776. {
  777.     kFWBIBHeaderAddress            = kCSRBIBHeaderAddress,
  778.     kFWBIBBusNameAddress        = kCSRBIBBusNameAddress,
  779.     kFWBIBNodeCapabilitiesAddress
  780.                                 = kCSRROMBaseAddress + 8,
  781.     kFWBIBNodeUniqueIDHiAddress    = kCSRROMBaseAddress + 12,
  782.     kFWBIBNodeUniqueIDLoAddress    = kCSRROMBaseAddress + 16,
  783.  
  784.     kFWBIBBusName                = '1394',
  785.  
  786.     kFWBIBIrmc                    = kFWBit0,
  787.     kFWBIBCmc                    = kFWBit1,
  788.     kFWBIBIsc                    = kFWBit2,
  789.     kFWBIBBmc                    = kFWBit3,
  790.     kFWBIBCycClkAcc                = FWBitRange (8, 15),
  791.     kFWBIBCycClkAccPhase        = FWBitRangePhase (8, 15),
  792.     kFWBIBMaxRec                = FWBitRange (16, 19),
  793.     kFWBIBMaxRecPhase            = FWBitRangePhase (16, 19)
  794. };
  795.  
  796.  
  797. ////////////////////////////////////////////////////////////////////////////////
  798. //
  799. // FireWire ID defs.
  800. //
  801.  
  802. typedef struct OpaqueFWReferenceID*            FWReferenceID;
  803. typedef struct OpaqueFWCommandObjectID*        FWCommandObjectID;
  804. typedef struct OpaqueFWCommandID*            FWCommandID;
  805. typedef struct OpaqueFWIMCommandID*            FWIMCommandID;
  806. typedef struct OpaqueFWClientCommandID*        FWClientCommandID;
  807. typedef struct OpaqueFWIMProcessID*            FWIMProcessID;
  808. typedef struct OpaqueIsochChannelID*        IsochChannelID;
  809. typedef struct OpaqueIsochPortID*            IsochPortID;
  810. typedef struct OpaqueDCLProgramID*            DCLProgramID;
  811. typedef struct OpaqueFWAddressSpaceID*        FWAddressSpaceID;
  812. typedef struct OpaqueFWDeferredTaskID*        FWDeferredTaskID;
  813. typedef FWReferenceID            FWIMID;
  814. typedef FWReferenceID            FWDeviceID;
  815. typedef FWReferenceID            FWUnitID;
  816. typedef FWReferenceID            FWClientID;
  817. typedef FWReferenceID            FWDriverID;
  818. typedef FWReferenceID            FWVDeviceID;
  819. typedef FWReferenceID            FWPDriverID;
  820. typedef FWReferenceID            FWIsochResourceManagerID;
  821.  
  822. enum
  823. {
  824.     kInvalidFWReferenceID        = 0,                    // zzz should use generic invalid ID
  825.     kInvalidFWIMID                = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWIM
  826.     kInvalidFWDeviceID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  827.     kInvalidFWUnitID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  828.     kInvalidFWClientID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  829.     kInvalidFWDriverID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  830.     kInvalidFWVDeviceID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  831.     kInvalidFWPDriverID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  832.     kInvalidFWIsochResourceManagerID    = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  833.     kInvalidFWCommandObjectID    = 0,                    // zzz should use generic invalid ID
  834.     kInvalidFWCommandID            = 0,                    // zzz should use generic invalid ID
  835.     kInvalidFWIMCommandID        = 0,                    // zzz should use generic invalid ID
  836.     kInvalidFWClientCommandID    = 0,                    // zzz should use generic invalid ID
  837.     kInvalidFWIMProcessID        = 0,                    // zzz should use generic invalid ID
  838.     kInvalidIsochChannelID        = 0,                    // zzz should use generic invalid ID
  839.     kInvalidIsochPortID            = 0,                    // zzz should use generic invalid ID ID for an invalid FWIM
  840.     kInvalidDCLProgramID        = 0,                    // zzz should use generic invalid ID
  841.     kInvalidFWAddressSpaceID    = 0,                    // zzz should use generic invalid ID
  842.     kInvalidFWDeferredTaskID    = 0                        // zzz should use generic invalid ID
  843. };
  844.  
  845.  
  846. ////////////////////////////////////////////////////////////////////////////////
  847. //
  848. // FireWire deferred task defs.
  849. //
  850.  
  851. typedef void    (FWDeferredTaskProc) (
  852.     void                        *param1,
  853.     void                        *param2);
  854. typedef FWDeferredTaskProc        *FWDeferredTaskProcPtr;
  855.  
  856.  
  857. ////////////////////////////////////////////////////////////////////////////////
  858. //
  859. // Address space defs.
  860. //
  861.  
  862. enum
  863. {
  864.     kFWAddressWriteEnable            = kFWBit31,
  865.     kFWAddressWriteRequestNotify    = kFWBit30,
  866.     kFWAddressWriteCompleteNotify    = kFWBit29,
  867.     kFWAddressReadEnable            = kFWBit28,
  868.     kFWAddressReadRequestNotify        = kFWBit27,
  869.     kFWAddressReadCompleteNotify    = kFWBit26,
  870.     kFWAddressLockEnable            = kFWBit25,
  871.     kFWAddressLockRequestNotify        = kFWBit24,
  872.     kFWAddressLockCompleteNotify    = kFWBit23,
  873.     kFWAddressLocation                = FWBitRange (21, 22),
  874.     kFWAddressLocationPhase            = FWBitRangePhase (21, 22),
  875.     kFWAddressInitialMemorySpace    = 0,
  876.     kFWAddressPrivateSpace            = 1,
  877.     kFWAddressInitialUnitsSpace        = 2,
  878.     kFWAddressOffsetInitialUnitsSpace    = 3,
  879.     kFWAddressPhysical                = 4
  880. };
  881.  
  882.  
  883. ////////////////////////////////////////////////////////////////////////////////
  884. //
  885. // Isochronous channel defs.
  886. //
  887.  
  888. enum
  889. {
  890.     kFWIsochChannelUnknownCondition        = 0,
  891.     kFWIsochChannelNotEnoughBandwidth    = 1,
  892.     kFWIsochChannelChannelNotAvailable    = 2
  893. };
  894.  
  895. typedef OSStatus    (FWIsochChannelForceStopNotificationProc) (
  896.     IsochChannelID                isochChannelID,
  897.     UInt32                        stopCondition);
  898. typedef FWIsochChannelForceStopNotificationProc
  899.                                 *FWIsochChannelForceStopNotificationProcPtr;
  900.  
  901.  
  902. ////////////////////////////////////////////////////////////////////////////////
  903. //
  904. // Isochronous channel defs.
  905. //
  906.  
  907. enum
  908. {
  909.     kFWDCLImmediateEvent        = 0,
  910.     kFWDCLCycleEvent            = 1,
  911.     kFWDCLSyBitsEvent            = 2
  912. };
  913.  
  914. enum
  915. {
  916.     kFWDCLInvalidNotification    = 0,
  917.     kFWDCLUpdateNotification    = 1,
  918.     kFWDCLModifyNotification    = 2
  919. };
  920.  
  921. enum
  922. {
  923.     kFWDCLOpDynamicFlag            = (1 << 16),
  924.     kFWDCLOpVendorDefinedFlag    = (1 << 17),
  925.     kFWDCLOpFlagMask            = BitRange (16, 31),
  926.     kFWDCLOpFlagPhase            = BitRangePhase (16, 31)
  927. };
  928.  
  929. enum
  930. {
  931.     kDCLInvalidOp                = 0,
  932.     kDCLSendPacketStartOp        = 1,
  933.     kDCLSendPacketWithHeaderStartOp
  934.                                 = 2,
  935.     kDCLSendPacketOp            = 3,
  936.     kDCLSendBufferOp            = 4,
  937.     kDCLReceivePacketStartOp    = 5,
  938.     kDCLReceivePacketOp            = 6,
  939.     kDCLReceiveBufferOp            = 7,
  940.     kDCLCallProcOp                = 8,
  941.     kDCLLabelOp                    = 9,
  942.     kDCLJumpOp                    = 10,
  943.     kDCLSetTagSyncBitsOp        = 11,
  944.     kDCLUpdateDCLListOp            = 12,
  945.     kDCLTimeStampOp                = 13
  946. };
  947.  
  948. typedef struct DCLCommandStruct
  949.                                 DCLCommand,
  950.                                 *DCLCommandPtr;
  951.  
  952. struct DCLCommandStruct
  953. {
  954.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  955.     UInt32                        compilerData;            // Data for use by DCL compiler.
  956.     UInt32                        opcode;                    // DCL opcode.
  957.     UInt32                        operands[1];            // DCL operands.
  958. };
  959.  
  960. struct DCLTransferPacketStruct
  961. {
  962.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  963.     UInt32                        compilerData;            // Data for use by DCL compiler.
  964.     UInt32                        opcode;                    // DCL opcode.
  965.     Ptr                            buffer;                    // Packet buffer.
  966.     UInt32                        size;                    // Buffer size.
  967. };
  968. typedef struct DCLTransferPacketStruct
  969.                                 DCLTransferPacket,
  970.                                 *DCLTransferPacketPtr;
  971.  
  972. struct DCLTransferBufferStruct
  973. {
  974.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  975.     UInt32                        compilerData;            // Data for use by DCL compiler.
  976.     UInt32                        opcode;                    // DCL opcode.
  977.     Ptr                            buffer;                    // Buffer.
  978.     UInt32                        size;                    // Buffer size.
  979.     UInt16                        packetSize;                // Size of packets to send.
  980.     UInt16                        reserved;
  981.     UInt32                        bufferOffset;            // Current offset into buffer.
  982. };
  983. typedef struct DCLTransferBufferStruct
  984.                                 DCLTransferBuffer,
  985.                                 *DCLTransferBufferPtr;
  986.  
  987. typedef void    (DCLCallCommandProc) (
  988.     DCLCommandPtr                pDCLCommand);
  989. typedef DCLCallCommandProc        *DCLCallCommandProcPtr;
  990.  
  991. struct DCLCallProcStruct
  992. {
  993.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  994.     UInt32                        compilerData;            // Data for use by DCL compiler.
  995.     UInt32                        opcode;                    // DCL opcode.
  996.     DCLCallCommandProcPtr        proc;                    // Procedure to call.
  997.     UInt32                        procData;                // Data for use by called procedure.
  998. };
  999. typedef struct DCLCallProcStruct
  1000.                                 DCLCallProc,
  1001.                                 *DCLCallProcPtr;
  1002.  
  1003. struct DCLLabelStruct
  1004. {
  1005.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1006.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1007.     UInt32                        opcode;                    // DCL opcode.
  1008. };
  1009. typedef struct DCLLabelStruct
  1010.                                 DCLLabel,
  1011.                                 *DCLLabelPtr;
  1012.  
  1013. struct DCLJumpStruct
  1014. {
  1015.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1016.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1017.     UInt32                        opcode;                    // DCL opcode.
  1018.     DCLLabelPtr                    pJumpDCLLabel;            // DCL label to jump to.
  1019. };
  1020. typedef struct DCLJumpStruct
  1021.                                 DCLJump,
  1022.                                 *DCLJumpPtr;
  1023.  
  1024. struct DCLSetTagSyncBitsStruct
  1025. {
  1026.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1027.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1028.     UInt32                        opcode;                    // DCL opcode.
  1029.     UInt16                        tagBits;                // Tag bits for following packets.
  1030.     UInt16                        syncBits;                // Sync bits for following packets.
  1031. };
  1032. typedef struct DCLSetTagSyncBitsStruct
  1033.                                 DCLSetTagSyncBits,
  1034.                                 *DCLSetTagSyncBitsPtr;
  1035.  
  1036. struct DCLUpdateDCLListStruct
  1037. {
  1038.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1039.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1040.     UInt32                        opcode;                    // DCL opcode.
  1041.     DCLCommandPtr                *dclCommandList;        // List of DCL commands to update.
  1042.     UInt32                        numDCLCommands;            // Number of DCL commands in list.
  1043. };
  1044. typedef struct DCLUpdateDCLListStruct
  1045.                                 DCLUpdateDCLList,
  1046.                                 *DCLUpdateDCLListPtr;
  1047.  
  1048. struct DCLTimeStampStruct
  1049. {
  1050.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1051.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1052.     UInt32                        opcode;                    // DCL opcode.
  1053.     UInt32                        timeStamp;                // Time stamp.
  1054. };
  1055. typedef struct DCLTimeStampStruct
  1056.                                 DCLTimeStamp,
  1057.                                 *DCLTimeStampPtr;
  1058.  
  1059. typedef OSStatus    (DCLProgramStartProc) (
  1060.     DCLProgramID                dclProgramID);
  1061. typedef DCLProgramStartProc        *DCLProgramStartProcPtr;
  1062.  
  1063. typedef OSStatus    (DCLProgramStopProc) (
  1064.     DCLProgramID                dclProgramID);
  1065. typedef DCLProgramStopProc        *DCLProgramStopProcPtr;
  1066.  
  1067. typedef OSStatus    (DCLProgramReleaseProc) (
  1068.     DCLProgramID                dclProgramID);
  1069. typedef DCLProgramReleaseProc    *DCLProgramReleaseProcPtr;
  1070.  
  1071. typedef OSStatus    (DCLCompilerNotificationProc) (
  1072.     DCLProgramID                dclProgramID,
  1073.     UInt32                        notificationType,
  1074.     DCLCommandPtr                *dclCommandList,
  1075.     UInt32                        numDCLCommands);
  1076. typedef DCLCompilerNotificationProc
  1077.                                 *DCLCompilerNotificationProcPtr;
  1078.  
  1079.  
  1080. ////////////////////////////////////////////////////////////////////////////////
  1081. //
  1082. // Define some bus management constants.
  1083. //
  1084.  
  1085. enum
  1086. {
  1087.     kFWBusManagerArbitrationTimeoutDuration
  1088.                                 = 625 * durationMillisecond
  1089. };
  1090.  
  1091.  
  1092. ////////////////////////////////////////////////////////////////////////////////
  1093. //
  1094. // Define some bus characteristics.
  1095. //
  1096.  
  1097. enum
  1098. {
  1099.     kFWMaxBusses                = 1023,
  1100.     kFWMaxNodesPerBus            = 63,
  1101.     kFWMaxNodeHops                = 16
  1102. };
  1103.  
  1104.  
  1105. ////////////////////////////////////////////////////////////////////////////////
  1106. //
  1107. // Packet defs.
  1108. //
  1109.  
  1110. // Phy packet defs.
  1111.  
  1112. enum
  1113. {
  1114.     kFWPhyPacketID                = FWBitRange (0, 1),
  1115.     kFWPhyPacketIDPhase            = FWBitRangePhase (0, 1),
  1116.  
  1117.     kFWPhyPacketPhyID            = FWBitRange (2, 7),
  1118.     kFWPhyPacketPhyIDPhase        = FWBitRangePhase (2, 7)
  1119. };
  1120.  
  1121. enum
  1122. {
  1123.     kSelfIDPacketSize            = 8,//zzz add FW
  1124.     kMaxSelfIDPacketsPerNode    = 9//zzz add FW
  1125. };
  1126.  
  1127. enum
  1128. {
  1129.     kFWConfigurationPacketID    = 0,
  1130.     kFWLinkOnPacketID            = 1,
  1131.     kFWSelfIDPacketID            = 2
  1132. };
  1133.  
  1134. enum
  1135. {
  1136.     kFWPhyConfigurationR        = kFWBit8,
  1137.     kFWPhyConfigurationT        = kFWBit9,
  1138.     kFWPhyConfigurationGapCnt    = FWBitRange (10, 15),
  1139.     kFWPhyConfigurationGapCntPhase
  1140.                                 = FWBitRangePhase (10, 15)
  1141. };
  1142.  
  1143. enum
  1144. {
  1145.     kFWSelfIDPortStatusChild    = 3,
  1146.     kFWSelfIDPortStatusParent    = 2,
  1147.     kFWSelfIDPortStatusNotConnected    = 1,
  1148.     kFWSelfIDPortStatusNotPresent    = 0,
  1149.  
  1150.     kFWSelfIDNoPower            = 0,
  1151.     kFWSelfIDSelfPowered15W        = 1,
  1152.     kFWSelfIDSelfPowered30W        = 2,
  1153.     kFWSelfIDSelfPowered45W        = 3,
  1154.     kFWSelfIDBusPowered1W        = 4,
  1155.     kFWSelfIDBusPowered3W        = 5,
  1156.     kFWSelfIDBusPowered6W        = 6,
  1157.     kFWSelfIDBusPowered10W        = 7,
  1158.  
  1159.     kFWSelfIDPhyID                = kFWPhyPacketPhyID,//zzz do we need or want this?
  1160.     kFWSelfIDPhyIDPhase            = kFWPhyPacketPhyIDPhase,
  1161.     kFWSelfIDM                    = kFWBit31,
  1162.  
  1163.     kFWSelfID0L                    = kFWBit9,
  1164.     kFWSelfID0GapCnt            = FWBitRange (10, 15),
  1165.     kFWSelfID0GapCntPhase        = FWBitRangePhase (10, 15),
  1166.     kFWSelfID0SP                = FWBitRange (16, 17),
  1167.     kFWSelfID0SPPhase            = FWBitRangePhase (16, 17),
  1168.     kFWSelfID0Del                = FWBitRange (18, 19),
  1169.     kFWSelfID0DelPhase            = FWBitRangePhase (18, 19),
  1170.     kFWSelfID0C                    = kFWBit20,
  1171.     kFWSelfID0Pwr                = FWBitRange (21, 23),
  1172.     kFWSelfID0PwrPhase            = FWBitRangePhase (21, 23),
  1173.     kFWSelfID0P0                = FWBitRange (24, 25),
  1174.     kFWSelfID0P0Phase            = FWBitRangePhase (24, 25),
  1175.     kFWSelfID0P1                = FWBitRange (26, 27),
  1176.     kFWSelfID0P1Phase            = FWBitRangePhase (26, 27),
  1177.     kFWSelfID0P2                = FWBitRange (28, 29),
  1178.     kFWSelfID0P2Phase            = FWBitRangePhase (28, 29),
  1179.     kFWSelfID0I                    = kFWBit30,
  1180.  
  1181.     kFWSelfIDPacketType            = kFWBit8,
  1182.     kFWSelfIDNN                    = FWBitRange (9, 11),
  1183.     kFWSelfIDNNPhase            = FWBitRangePhase (9, 11),
  1184.     kFWSelfIDNPa                = FWBitRange (14, 15),
  1185.     kFWSelfIDNPaPhase            = FWBitRangePhase (14, 15),
  1186.     kFWSelfIDNPb                = FWBitRange (16, 17),
  1187.     kFWSelfIDNPbPhase            = FWBitRangePhase (16, 17),
  1188.     kFWSelfIDNPc                = FWBitRange (18, 19),
  1189.     kFWSelfIDNPcPhase            = FWBitRangePhase (18, 19),
  1190.     kFWSelfIDNPd                = FWBitRange (20, 21),
  1191.     kFWSelfIDNPdPhase            = FWBitRangePhase (20, 21),
  1192.     kFWSelfIDNPe                = FWBitRange (22, 23),
  1193.     kFWSelfIDNPePhase            = FWBitRangePhase (22, 23),
  1194.     kFWSelfIDNPf                = FWBitRange (24, 25),
  1195.     kFWSelfIDNPfPhase            = FWBitRangePhase (24, 25),
  1196.     kFWSelfIDNPg                = FWBitRange (26, 27),
  1197.     kFWSelfIDNPgPhase            = FWBitRangePhase (26, 27),
  1198.     kFWSelfIDNPh                = FWBitRange (28, 29),
  1199.     kFWSelfIDNPhPhase            = FWBitRangePhase (28, 29),
  1200.     kFWSelfIDMore                = kFWBit31
  1201. };
  1202.  
  1203. // Primary packet defs.
  1204.  
  1205. enum
  1206. {
  1207.     kFWSpeed100MBit                = 0,
  1208.     kFWSpeed200MBit                = 1,
  1209.     kFWSpeed400MBit                = 2,
  1210.     kFWSpeedMaximum                = 0x7FFFFFFF,            //zzz what are the best numbers???
  1211.     kFWSpeedInvalid                = 0x80000000
  1212. };
  1213.  
  1214. enum
  1215. {
  1216.     kFWTCodeWriteQuadlet        = 0,
  1217.     kFWTCodeWriteBlock            = 1,
  1218.     kFWTCodeWriteResponse        = 2,
  1219.     kFWTCodeReadQuadlet            = 4,
  1220.     kFWTCodeReadBlock            = 5,
  1221.     kFWTCodeReadQuadletResponse    = 6,
  1222.     kFWTCodeReadBlockResponse    = 7,
  1223.     kFWTCodeCycleStart            = 8,
  1224.     kFWTCodeLock                = 9,
  1225.     kFWTCodeIsochronousBlock    = 10,
  1226.     kFWTCodeLockResponse        = 11,
  1227.     kFWTCodePHYPacket            = 14
  1228. };
  1229.  
  1230. enum
  1231. {
  1232.     kFWExtendedTCodeMaskSwap    = 1,
  1233.     kFWExtendedTCodeCompareSwap    = 2,
  1234.     kFWExtendedTCodeFetchAdd    = 3,
  1235.     kFWExtendedTCodeLittleAdd    = 4,
  1236.     kFWExtendedTCodeBoundedAdd    = 5,
  1237.     kFWExtendedTCodeWrapAdd        = 6,
  1238.     kFWExtendedTCodeVendorDependent    = 7
  1239. };
  1240.  
  1241. enum
  1242. {
  1243.     kFWResponseComplete            = 0,
  1244.     kFWResponseConflictError    = 4,
  1245.     kFWResponseDataError        = 5,
  1246.     kFWResponseTypeError        = 6,
  1247.     kFWResponseAddressError        = 7
  1248. };
  1249.  
  1250. enum
  1251. {
  1252.     kFWAckComplete                = 1,
  1253.     kFWAckPending                = 2,
  1254.     kFWAckBusyX                    = 4,
  1255.     kFWAckBusyA                    = 5,
  1256.     kFWAckBusyB                    = 6,
  1257.     kFWAckDataError                = 13,
  1258.     kFWAckTypeError                = 14
  1259. };
  1260.  
  1261.  
  1262. enum
  1263. {
  1264.     kFWIsochDataLength            = FWBitRange (0, 15),
  1265.     kFWIsochDataLengthPhase        = FWBitRangePhase (0, 15),
  1266.     
  1267.     kFWIsochTag                    = FWBitRange (16, 17),
  1268.     kFWIsochTagPhase            = FWBitRangePhase (16, 17),
  1269.  
  1270.     kFWIsochChanNum                = FWBitRange (18, 23),
  1271.     kFWIsochChanNumPhase        = FWBitRangePhase (18, 23),
  1272.  
  1273.     kFWIsochTCode                = FWBitRange (24, 27),
  1274.     kFWIsochTCodePhase            = FWBitRangePhase (24, 27),
  1275.  
  1276.     kFWIsochSy                    = FWBitRange (28, 31),
  1277.     kFWIsochSyPhase                = FWBitRangePhase (28, 31)
  1278. };
  1279.  
  1280.  
  1281. // Topology map.
  1282.  
  1283. enum
  1284. {
  1285.     kFWTopologyMapMaxSelfIDs    = kFWMaxNodesPerBus * kMaxSelfIDPacketsPerNode
  1286. };
  1287.  
  1288. struct FWTopologyMapStruct
  1289. {
  1290.     UInt16                        length;
  1291.     UInt16                        CRC;
  1292.     UInt32                        generationNumber;
  1293.     UInt16                        nodeCount;
  1294.     UInt16                        selfIDCount;
  1295.     UInt32                        selfIDs[kFWTopologyMapMaxSelfIDs];
  1296. };
  1297. typedef struct FWTopologyMapStruct
  1298.                                 FWTopologyMap,
  1299.                                 *FWTopologyMapPtr;
  1300.  
  1301. // Speed map.
  1302.  
  1303. enum
  1304. {
  1305.     kFWSpeedMapMaxSpeedCodes    = (kFWMaxNodesPerBus + 1) * (kFWMaxNodesPerBus - 1) +
  1306.                                   (kFWMaxNodesPerBus - 1)
  1307. };
  1308.  
  1309. struct FWSpeedMapStruct
  1310. {
  1311.     UInt16                        length;
  1312.     UInt16                        CRC;
  1313.     UInt32                        generationNumber;
  1314.     UInt8                        speedCodes[kFWSpeedMapMaxSpeedCodes];
  1315. };
  1316. typedef struct FWSpeedMapStruct    FWSpeedMap,
  1317.                                 *FWSpeedMapPtr;
  1318.  
  1319. ////////////////////////////////////////////////////////////////////////////////
  1320. //
  1321. // FireWire client defs.
  1322. //
  1323.  
  1324. enum
  1325. {
  1326.     kFWClientCommandQueueActiveBit    = 0,
  1327.     kFWClientCommandQueueActiveByte    = 1,
  1328.     kFWClientCommandQueueActive        = (1 << kFWClientCommandQueueActiveBit)
  1329. };
  1330.  
  1331. enum
  1332. {
  1333.     kFWClientCommandBusy        = 1,
  1334.     kFWClientCommandWaiting        = 2
  1335. };
  1336.  
  1337. enum
  1338. {
  1339.     kFWClientCommandSyncFlag    = (1 << 0),
  1340.     kFWClientCommandImmediateFlag    = (1 << 1)
  1341. };
  1342.  
  1343. enum
  1344. {
  1345.     kFWClientCommandAcceptNoMore
  1346.                                 = 0,
  1347.     kFWClientCommandAcceptMore    = 1,
  1348.     kFWClientCommandRejected    = 2
  1349. };
  1350.  
  1351. enum
  1352. {
  1353.     kFWClientResetNotify        = 1,                    // Notify client that a reset occured.
  1354.     kFWClientBusManagementNotify    = 2,                // Notify client that a reset occured and bus management has been established.
  1355.     kFWClientReadRequest        = 3,                    // Read request from client's address space.
  1356.     kFWClientReadComplete        = 4,                    // Read complete from client's address space.
  1357.     kFWClientWriteRequest        = 5,                    // Write request to a client's address space.
  1358.     kFWClientWriteComplete        = 6,                    // Write complete to a client's address space.
  1359.     kFWClientLockRequest        = 7,                    // Lock request to a client's address space.
  1360.     kFWClientLockComplete        = 8,                    // Lock complete to a client's address space.
  1361.     kFWClientInitIsochPort        = 9,                    // Initialize an isochronous port.
  1362.     kFWClientReleaseIsochPort    = 10,                    // Release resources allocated for isochronous port.
  1363.     kFWClientStartIsochPort        = 11,                    // Start data flow through isoch port.
  1364.     kFWClientStopIsochPort        = 12,                    // Stop data flow through isoch port.
  1365.     kFWClientSBP2LoginNotify    = 13,                    // Login-related notification
  1366.     kFWClientSBP2StatusNotify    = 14,                    // ORB-related notification
  1367.     kFWClientSBP2UnsolicitedStatusNotify    = 15        // Unsolicited SBP-2 status
  1368. };
  1369.  
  1370.  
  1371. // Define FireWire Client command param structures.
  1372.  
  1373. typedef struct FWClientInterfaceParamsStruct
  1374.                                 FWClientInterfaceParams,
  1375.                                 *FWClientInterfaceParamsPtr;
  1376.  
  1377. typedef void    (FWClientCommandCompletionProc) (
  1378.     FWClientInterfaceParamsPtr    pFWClientInterfaceParams);
  1379. typedef FWClientCommandCompletionProc
  1380.                                 *FWClientCommandCompletionProcPtr;
  1381.  
  1382. struct FWClientInterfaceParamsStruct
  1383. {
  1384.     UInt32                        interfaceSelector;        // Selector indicating the type of request.
  1385.     FWReferenceID                fwReferenceID;            // Reference to target of command.
  1386.     FWClientCommandID            fwClientCommandID;        // ID for this command.
  1387.     UInt32                        fwClientSpecificData;    // Data specific to the FireWire client.
  1388. };
  1389.  
  1390. struct FWClientAsynchRequestParamsStruct
  1391. {
  1392.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1393.     UInt32                        generation;                // Generation number that request was received on.
  1394.     Ptr                            receiveBuffer;            // Pointer to buffer with receive data.
  1395.     Ptr                            transmitBuffer;            // Pointer to buffer with transmit data.
  1396.     UInt16                        sourceID;                // Node ID of source of the request.
  1397.     UInt16                        responseCode;            // Response code.
  1398.     UInt32                        offset;                    // Offset of request within target address space.
  1399.     UInt16                        length;                    // Length of request.
  1400.     UInt16                        extendedTCode;            // Extended transaction code.
  1401.     FWAddressSpaceID            fwAddressSpaceID;        // ID of the target address space.
  1402.     Ptr                            pAddressSpecificData;    // Pointer to data specific to the address space.
  1403.     UInt32                        speed;                    // Received speed, and speed to reply at.
  1404. };
  1405. typedef struct FWClientAsynchRequestParamsStruct
  1406.                                 FWClientAsynchRequestParams,
  1407.                                 *FWClientAsynchRequestParamsPtr;
  1408.  
  1409. struct FWClientIsochPortParamsStruct
  1410. {
  1411.     IsochChannelID                isochChannelID;            // Reference to the channel that this port belongs to.
  1412.     UInt32                        refCon;                    // Reference constant for specific port.
  1413.     Boolean                        portIsTalker;            // Boolean indicating that this channel is the talker.
  1414. };
  1415. typedef struct FWClientIsochPortParamsStruct
  1416.                                 FWClientIsochPortParams,
  1417.                                 *FWClientIsochPortParamsPtr;
  1418.  
  1419. struct FWClientInitIsochPortParamsStruct
  1420. {
  1421.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1422.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1423.     UInt32                        channelNum;                // Channel number for port.
  1424.     UInt32                        supportedChannelNumHi,    // Channel numbers supported by port.
  1425.                                 supportedChannelNumLo;
  1426.     UInt32                        speed;                    // Speed of channel.
  1427.     Boolean                        trial;                    // Boolean indicating that this call is just a trial.
  1428. };
  1429. typedef struct FWClientInitIsochPortParamsStruct
  1430.                                 FWClientInitIsochPortParams,
  1431.                                 *FWClientInitIsochPortParamsPtr;
  1432.  
  1433. struct FWClientReleaseIsochPortParamsStruct
  1434. {
  1435.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1436.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1437. };
  1438. typedef struct FWClientReleaseIsochPortParamsStruct
  1439.                                 FWClientReleaseIsochPortParams,
  1440.                                 *FWClientReleaseIsochPortParamsPtr;
  1441.  
  1442. struct FWClientIsochPortControlParamsStruct
  1443. {
  1444.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1445.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1446. };
  1447. typedef struct FWClientIsochPortControlParamsStruct
  1448.                                 FWClientIsochPortControlParams,
  1449.                                 *FWClientIsochPortControlParamsPtr;
  1450.  
  1451. struct FWClientPowerNotifyParamsStruct
  1452. {
  1453.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1454.     FWCommandObjectID            fwCommandObjectID;            // Power command object ID
  1455.     UInt32                        notificationEvent;
  1456. };
  1457. typedef struct FWClientPowerNotifyParamsStruct
  1458.                                 FWClientPowerNotifyParams,
  1459.                                 *FWClientPowerNotifyParamsPtr;
  1460.  
  1461.  
  1462. // Define FireWire Client procs.
  1463.  
  1464. typedef OSStatus    (FWClientInterfaceProc) (
  1465.     FWClientInterfaceParamsPtr    pFWClientInterfaceParams,
  1466.     UInt32                        *pCommandAcceptance);
  1467. typedef FWClientInterfaceProc    *FWClientInterfaceProcPtr;
  1468.  
  1469. typedef FWClientInterfaceProc    FWClientResetNotifyProc,
  1470.                                 *FWClientResetNotifyProcPtr;
  1471.  
  1472. typedef OSStatus    (FWClientReadProc) (
  1473.     FWClientAsynchRequestParamsPtr
  1474.                                 pAsynchRequestParams,
  1475.     UInt32                        *pCommandAcceptance);
  1476. typedef FWClientReadProc        *FWClientReadProcPtr;
  1477.  
  1478. typedef OSStatus    (FWClientWriteProc) (
  1479.     FWClientAsynchRequestParamsPtr
  1480.                                 pAsynchRequestParams,
  1481.     UInt32                        *pCommandAcceptance);
  1482. typedef FWClientWriteProc        *FWClientWriteProcPtr;
  1483.  
  1484. typedef OSStatus    (FWClientLockProc) (
  1485.     FWClientAsynchRequestParamsPtr
  1486.                                 pAsynchRequestParams,
  1487.     UInt32                        *pCommandAcceptance);
  1488. typedef FWClientLockProc        *FWClientLockProcPtr;
  1489.  
  1490. typedef OSStatus    (FWClientInitIsochPortProc) (
  1491.     FWClientInitIsochPortParamsPtr
  1492.                                 pInitIsochPortParams,
  1493.     UInt32                        *pCommandAcceptance);
  1494. typedef FWClientInitIsochPortProc
  1495.                                 *FWClientInitIsochPortProcPtr;
  1496.  
  1497. typedef OSStatus    (FWClientReleaseIsochPortProc) (
  1498.     FWClientReleaseIsochPortParamsPtr
  1499.                                 pReleaseIsochPortParams,
  1500.     UInt32                        *pCommandAcceptance);
  1501. typedef FWClientReleaseIsochPortProc
  1502.                                 *FWClientReleaseIsochPortProcPtr;
  1503.  
  1504. typedef OSStatus    (FWClientStartIsochPortProc) (
  1505.     FWClientIsochPortControlParamsPtr
  1506.                                 pIsochPortControlParams,
  1507.     UInt32                        *pCommandAcceptance);
  1508. typedef FWClientStartIsochPortProc
  1509.                                 *FWClientStartIsochPortProcPtr;
  1510.  
  1511. typedef OSStatus    (FWClientStopIsochPortProc) (
  1512.     FWClientIsochPortControlParamsPtr
  1513.                                 pIsochPortControlParams,
  1514.     UInt32                        *pCommandAcceptance);
  1515. typedef FWClientStopIsochPortProc
  1516.                                 *FWClientStopIsochPortProcPtr;
  1517.  
  1518. typedef OSStatus    (FWClientPowerNotifyProc) (
  1519.     FWClientPowerNotifyParamsPtr
  1520.                                 pPowerNotifyParams,
  1521.     UInt32                        *pCommandAcceptance);
  1522. typedef FWClientPowerNotifyProc    *FWClientPowerNotifyProcPtr;
  1523.  
  1524.  
  1525. ////////////////////////////////////////////////////////////////////////////////
  1526. //
  1527. // Gestalt defs - JKL: need to go into MasterInterfaces Gestalt.i
  1528. //
  1529.  
  1530. enum {
  1531.     gestaltFireWireVersion        = 'fwve',        // FireWire version
  1532.     kFireWireVersion            = 0x0200,        // current SDK version is 2.0
  1533.     gestaltFireWireAttr            = 'fwat',        // FireWire attributes
  1534.     gestaltHasFireWirePorts        = 0x00000001    // bit 0 set to 1 if FireWire hardware is detected
  1535. };
  1536.  
  1537. ////////////////////////////////////////////////////////////////////////////////
  1538. //
  1539. // FWIM defs.
  1540. //
  1541.  
  1542. // Define FWIM command types.
  1543.  
  1544. enum
  1545. {
  1546.     kFWIMSendLinkOnPacket
  1547.                                 = 1,                    // Send a phy configuration packet.
  1548.     kFWIMSendPhyConfigurationPacket
  1549.                                 = 2,                    // Send a phy configuration packet.
  1550.     kFWIMRead                    = 3,                    // Perform a read transaction.
  1551.     kFWIMReadResponse            = 4,                    // Transmit a read response.
  1552.     kFWIMWrite                    = 5,                    // Perform a write transaction.
  1553.     kFWIMWriteResponse            = 6,                    // Transmit a write response.
  1554.     kFWIMLock                    = 7,                    // Perform a lock transaction.
  1555.     kFWIMLockResponse            = 8,                    // Transmit a lock response.
  1556.     kFWIMAllocateIsochPort        = 9,                    // Allocate an isochronous port.
  1557.     kFWIMReleaseIsochPort        = 10,                    // Release resources allocated for an isochronous port.
  1558.     kFWIMStartIsochPort            = 11,                    // Start isochronous port.
  1559.     kFWIMStopIsochPort            = 12,                    // Stop isochronous port.
  1560.     kFWIMResetBus                = 13,                    // Reset the FireWire bus.
  1561.     kFWIMSetContenderBit        = 14,                    // Set the contender bit on the next bus reset.
  1562.     kFWIMClearContenderBit        = 15,                    // Clear the contender bit on the next bus reset.
  1563.     kFWIMEnableCycleMaster        = 16,                    // Enable cycle mastering.
  1564.     kFWIMDisableCycleMaster        = 17,                    // Disable cycle mastering.
  1565.     kFWIMSetRootHoldoffBit        = 18,                    // Set the root holdoff bit.
  1566.     kFWIMClearRootHoldoffBit    = 19,                    // Clear the root holdoff bit.
  1567.     kFWIMGetUniqueID            = 20,                    // Get the local unique ID.
  1568.     kFWIMSetCSRROM                = 21,                    // Set new CSR ROM data.
  1569.     kFWIMDoLocalCompareSwap        = 22,                    // Do a Compare/Swap (OpenHCI IRM only).
  1570.     kFWIMSetAsynchFilters        = 23,                    // Set asynch/physical filters.
  1571.     kFWIMSetFWIMState            = 24                    // Sleep/Wake/Quiesce FWIM for power saving or replacement.
  1572. };
  1573.  
  1574.  
  1575. // Defs for calls from the FWIM interface.
  1576.  
  1577. enum
  1578. {
  1579.     kFWIMProcessSelfIDs            = 1,
  1580.     kFWIMProcessRead            = 2,
  1581.     kFWIMProcessWrite            = 3,
  1582.     kFWIMProcessLock            = 4
  1583. };
  1584.  
  1585. // Defs for calls to the FWIM interface.
  1586. //zzz some of this stuff should be private
  1587.  
  1588. enum
  1589. {
  1590.     kFWIMCommandSyncFlag        = (1 << 0),                // Perform FWIM command synchronously.
  1591.     kFWIMCommandPriorityFlag    = (1 << 1),                // This is a priority command.
  1592.     kFWIMCommandImmediateFlag    = (1 << 2)                // Perform FWIM command immediately.
  1593. };
  1594.  
  1595. enum
  1596. {
  1597.     kFWIMCommandQueueActiveBit    = 0,
  1598.     kFWIMCommandQueueActiveByte    = 1,
  1599.     kFWIMCommandQueueActive        = (1 << kFWIMCommandQueueActiveBit),
  1600.  
  1601.     kFWIMCommandQueueDisabledBit    = 1,
  1602.     kFWIMCommandQueueDisabledByte    = 1,
  1603.     kFWIMCommandQueueDisabled        = (1 << kFWIMCommandQueueDisabledBit)
  1604. };
  1605.  
  1606. enum
  1607. {
  1608.     kFWIMCommandBusy            = 1
  1609. };
  1610.  
  1611. enum
  1612. {
  1613.     kFWIMCommandAcceptNoMore    = 0,
  1614.     kFWIMCommandAcceptMore        = 1,
  1615.     kFWIMCommandRejected        = 2
  1616. };
  1617.  
  1618. enum
  1619. {
  1620.     kFWIMFeatureCSRROMMap        = (1 << 0),                // Has CSR ROM mapping function
  1621.     kFWIMFeatureIRM                = (1 << 1),                // Has IRM registers in hardware
  1622.     kFWIMFeaturePhysicalDMA        = (1 << 2),                // Has some kind of Physical DMA
  1623.     kFWIMFeatureAsynchFilters    = (1 << 3),                // Has OHCI-style asynch/phys filters
  1624.     kFWIMFeatureSetFWIMState    = (1 << 4)                // Can be slept/quiesced
  1625. };
  1626.  
  1627. typedef struct FWIMCommandParamsStruct
  1628.                                 FWIMCommandParams,
  1629.                                 *FWIMCommandParamsPtr;
  1630.  
  1631. typedef void    (FWIMCommandCompletionProc) (
  1632.     FWIMCommandParamsPtr        pFWIMCommandParams);
  1633. typedef FWIMCommandCompletionProc
  1634.                                 *FWIMCommandCompletionProcPtr;
  1635.  
  1636. struct FWIMInitializeParamsStruct
  1637. {
  1638.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1639.     FWIMID                        fwimID;                    // ID for this FWIM
  1640.     RegEntryID                    fwimRegEntryID;            // Name registry entry for FireWire bus device
  1641.     UInt32                        fwimFeatures;            // Return area for FWIM features
  1642.     UInt32                        fwimCSRROMMapLength;    // Length of CSR ROM mapper, if available
  1643.     UInt32                        fwimDeciWatts;            // Deciwatts provided by hardware
  1644.     UInt32                        fwimDeciVoltsMinimum;    // Minimum decivolts at above load
  1645.     UInt32                        fwimDeciVoltsMaximum;    // Maximum decivolts at no load
  1646. };
  1647. typedef struct FWIMInitializeParamsStruct
  1648.                                 FWIMInitializeParams,
  1649.                                 *FWIMInitializeParamsPtr;
  1650.  
  1651. struct FWIMFinalizeParamsStruct
  1652. {
  1653.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1654.     FWIMID                        fwimID;                    // ID for this FWIM
  1655.     RegEntryID                    fwimRegEntryID;            // Name registry entry for FireWire bus device
  1656. };
  1657. typedef struct FWIMFinalizeParamsStruct
  1658.                                 FWIMFinalizeParams,
  1659.                                 *FWIMFinalizeParamsPtr;
  1660.  
  1661. struct FWIMPollInterruptsParamsStruct
  1662. {
  1663.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1664.     FWIMID                        fwimID;                    // ID for this FWIM
  1665. };
  1666. typedef struct FWIMPollInterruptsParamsStruct
  1667.                                 FWIMPollInterruptsParams,
  1668.                                 *FWIMPollInterruptsParamsPtr;
  1669.  
  1670. struct FWIMCommandParamsStruct
  1671. {
  1672.     UInt32                        commandType;            // Type of command.
  1673.     FWIMID                        fwimID;                    // Reference to target FWIM.
  1674.     UInt32                        fwimSpecificData;        // Data specific to FWIM.
  1675.     FWIMCommandID                fwimCommandID;            // ID for this command.
  1676. };
  1677.  
  1678. struct FWIMGetUniqueIDParamsStruct
  1679. {
  1680.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1681.     CSRNodeUniqueID                uniqueID;                // Local unique ID.
  1682. };
  1683. typedef struct FWIMGetUniqueIDParamsStruct
  1684.                                 FWIMGetUniqueIDParams,
  1685.                                 *FWIMGetUniqueIDParamsPtr;
  1686.  
  1687. struct FWIMSendPhyPacketParamsStruct
  1688. {
  1689.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1690.     UInt32                        generation;                // FireWire bus generation number.
  1691.     Ptr                            buffer;                    // Buffer with phy packet data.
  1692.     UInt32                        length;                    // Length of packet data.
  1693.     UInt32                        commandStorage;            // Most common phy packets only need 4 bytes.
  1694. };
  1695. typedef struct FWIMSendPhyPacketParamsStruct
  1696.                                 FWIMSendPhyPacketParams,
  1697.                                 *FWIMSendPhyPacketParamsPtr;
  1698.  
  1699. struct FWIMSetCSRROMParamsStruct
  1700. {
  1701.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1702.     Ptr                            pCSRROM;                // Buffer with ROM image.
  1703.     UInt32                        length;                    // Length of valid ROM image.
  1704.     UInt32                        *clearWhenDone;            // UInt32 for FWIM to clear when complete.
  1705. };
  1706. typedef struct FWIMSetCSRROMParamsStruct
  1707.                                 FWIMSetCSRROMParams,
  1708.                                 *FWIMSetCSRROMParamsPtr;
  1709.  
  1710. // These are registers implemented in hardware by OpenHCI:
  1711. enum
  1712. {
  1713.     kFW_OHCI_BUS_MANAGER_ID                = 0,
  1714.     kFW_OHCI_BANDWIDTH_AVAILABLE        = 1,
  1715.     kFW_OHCI_CHANNELS_AVAILABLE_HI        = 2,
  1716.     kFW_OHCI_CHANNELS_AVAILABLE_LO        = 3
  1717. };
  1718.  
  1719. struct FWIMCompareSwapParamsStruct
  1720. {
  1721.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1722.     UInt32                        targetRegister;            // from above enum
  1723.     UInt32                        oldValue;                // value we think it is
  1724.     UInt32                        newValue;                // value we want it to be
  1725.     UInt32                        returnValue;            // result
  1726. };
  1727. typedef struct FWIMCompareSwapParamsStruct
  1728.                                 FWIMCompareSwapParams,
  1729.                                 *FWIMCompareSwapParamsPtr;
  1730.  
  1731. struct FWIMSetAsynchFiltersParamsStruct
  1732. {
  1733.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1734.     UInt32                        asynchFilterHi;            // Asynchronous receive filter.
  1735.     UInt32                        asynchFilterLo;
  1736.     UInt32                        physicalFilterHi;        // Physical DMA filter.
  1737.     UInt32                        physicalFilterLo;
  1738. };
  1739. typedef struct FWIMSetAsynchFiltersParamsStruct
  1740.                                 FWIMSetAsynchFiltersParams,
  1741.                                 *FWIMSetAsynchFiltersParamsPtr;
  1742.  
  1743. struct FWIMSetFWIMStateParamsStruct
  1744. {
  1745.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1746.     Boolean                        fwimState;                // Active,standby,etc.
  1747. };
  1748. typedef struct FWIMSetFWIMStateParamsStruct
  1749.                                 FWIMSetFWIMStateParams,
  1750.                                 *FWIMSetFWIMStateParamsPtr;
  1751.  
  1752. struct FWIMAsynchCommandParamsStruct
  1753. {
  1754.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1755.     Duration                    timeout;                // Split transaction timeout.
  1756.     UInt32                        generation;                // FireWire bus generation number.
  1757.     Ptr                            buffer;                    // Local buffer to read/write into/from
  1758.     UInt8                        numRetries;                // Number of retries left.
  1759.     UInt8                        speed;                    // Transmission speed.
  1760.     UInt16                        reserved;
  1761.     UInt32                        addressHi,
  1762.                                 addressLo;                // FireWire bus address to read/write from/to
  1763.     UInt16                        length;                    // Length of read/write
  1764.     UInt16                        extendedTCode;            // Extended transaction code.
  1765. };
  1766. typedef struct FWIMAsynchCommandParamsStruct
  1767.                                 FWIMAsynchCommandParams,
  1768.                                 *FWIMAsynchCommandParamsPtr;
  1769.  
  1770. enum
  1771. {
  1772.     kFWTransactionDescriptorTLabel        = FWBitRange (16, 21),
  1773.     kFWTransactionDescriptorTLabelPhase    = FWBitRangePhase (16, 21)
  1774. };
  1775.  
  1776. enum //zzz need FWBitRange16
  1777. {
  1778.     kFWResponseDataRCode        = FWBitRange (16, 19),
  1779.     kFWResponseDataRCodePhase    = FWBitRangePhase (16, 19)
  1780. };
  1781.  
  1782. struct FWIMAsynchResponseCommandParamsStruct
  1783. {
  1784.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1785.     AbsoluteTime                timeout;                // Timeout for this response.
  1786.     UInt32                        generation;                // Topology map generation number this response is valid for.
  1787.     Ptr                            buffer;                    // Response buffer.
  1788.     UInt8                        numRetries;                // Number of retries left.
  1789.     UInt8                        speed;                    // Transmission speed.
  1790.     UInt16                        transactionDescriptor;    // Descriptor for transaction.
  1791.     UInt16                        destinationID;            // Destination node ID for this response.
  1792.     UInt16                        responseDataHi;            // Response data for transaction.
  1793.     UInt32                        responseDataLo;
  1794.     UInt16                        length;                    // Length of response data.
  1795.     UInt16                        extendedTCode;            // Extended transaction code for this response.
  1796. };
  1797. typedef struct FWIMAsynchResponseCommandParamsStruct
  1798.                                 FWIMAsynchResponseCommandParams,
  1799.                                 *FWIMAsynchResponseCommandParamsPtr;
  1800.  
  1801. struct FWIMIsochPortCommandParamsStruct
  1802. {
  1803.     IsochPortID                    isochPortID;            // Isochronous port ID.
  1804.     UInt32                        fwimIsochPortData;        // Data for FWIM to use for this isoch port.
  1805. };
  1806. typedef struct FWIMIsochPortCommandParamsStruct
  1807.                                 FWIMIsochPortCommandParams,
  1808.                                 *FWIMIsochPortCommandParamsPtr;
  1809.  
  1810. struct FWIMAllocateIsochPortParamsStruct
  1811. {
  1812.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1813.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1814.     DCLProgramID                dclProgramID;            // DCL program for this port.
  1815.     UInt32                        channelNum;                // Isochronous channel number.
  1816.     UInt32                        speed;                    // Speed to use for channel.
  1817.     Boolean                        talking;                // Buffer is for talking (listening if false).
  1818. };
  1819. typedef struct FWIMAllocateIsochPortParamsStruct
  1820.                                 FWIMAllocateIsochPortParams,
  1821.                                 *FWIMAllocateIsochPortParamsPtr;
  1822.  
  1823. struct FWIMReleaseIsochPortParamsStruct
  1824. {
  1825.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1826.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1827. };
  1828. typedef struct FWIMReleaseIsochPortParamsStruct
  1829.                                 FWIMReleaseIsochPortParams,
  1830.                                 *FWIMReleaseIsochPortParamsPtr;
  1831.  
  1832. struct FWIMIsochPortControlParamsStruct
  1833. {
  1834.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1835.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1836. };
  1837. typedef struct FWIMIsochPortControlParamsStruct
  1838.                                 FWIMIsochPortControlParams,
  1839.                                 *FWIMIsochPortControlParamsPtr;
  1840.  
  1841. struct FWIMGetCycleTimeParamsStruct
  1842. {
  1843.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1844.     UInt32                        *pCycleTime;                // return value.
  1845. };
  1846. typedef struct FWIMGetCycleTimeParamsStruct
  1847.                                 FWIMGetCycleTimeParams,
  1848.                                 *FWIMGetCycleTimeParamsPtr;
  1849.  
  1850. // Define FWIM plug in dispatch table.
  1851.  
  1852. typedef OSStatus (FWIMInitializeProc) (
  1853.     FWIMInitializeParamsPtr        pFWIMInitializeParams);
  1854. typedef FWIMInitializeProc        *FWIMInitializeProcPtr;
  1855.  
  1856. typedef OSStatus (FWIMFinalizeProc) (
  1857.     FWIMFinalizeParamsPtr        pFWIMFinalizeParams);
  1858. typedef FWIMFinalizeProc        *FWIMFinalizeProcPtr;
  1859.  
  1860. typedef OSStatus (FWIMPollInterruptsProc) (
  1861.     FWIMPollInterruptsParamsPtr    pFWIMPollInterruptsParams);
  1862. typedef FWIMPollInterruptsProc    *FWIMPollInterruptsProcPtr;
  1863.  
  1864. typedef OSStatus (FWIMCommandProc) (
  1865.     FWIMCommandParamsPtr        pFWIMCommandParams,
  1866.     UInt32                        *pCommandAcceptance);
  1867. typedef FWIMCommandProc            *FWIMCommandProcPtr;
  1868.  
  1869. typedef OSStatus (FWIMSendPhyPacketProc) (
  1870.     FWIMSendPhyPacketParamsPtr    pFWIMSendPhyPacketParams,
  1871.     UInt32                        *pCommandAcceptance);
  1872. typedef FWIMSendPhyPacketProc    *FWIMSendPhyPacketProcPtr;
  1873.  
  1874. typedef OSStatus (FWIMAsynchTransactionProc) (
  1875.     FWIMAsynchCommandParamsPtr    pFWIMAsynchCommandParams,
  1876.     UInt32                        *pCommandAcceptance);
  1877. typedef FWIMAsynchTransactionProc
  1878.                                 *FWIMAsynchTransactionProcPtr;
  1879.  
  1880. typedef OSStatus (FWIMSendAsynchResponsePacketProc) (
  1881.     FWIMAsynchResponseCommandParamsPtr
  1882.                                 pFWIMAsynchResponseCommandParams,
  1883.     UInt32                        *pCommandAcceptance);
  1884. typedef FWIMSendAsynchResponsePacketProc
  1885.                                 *FWIMSendAsynchResponsePacketProcPtr;
  1886.  
  1887. typedef OSStatus (FWIMAllocateIsochPortProc) (
  1888.     FWIMAllocateIsochPortParamsPtr
  1889.                                 pFWIMAllocateIsochPortParams,
  1890.     UInt32                        *pCommandAcceptance);
  1891. typedef FWIMAllocateIsochPortProc
  1892.                                 *FWIMAllocateIsochPortProcPtr;
  1893.  
  1894. typedef OSStatus (FWIMReleaseIsochPortProc) (
  1895.     FWIMReleaseIsochPortParamsPtr
  1896.                                 pFWIMReleaseIsochPortParams,
  1897.     UInt32                        *pCommandAcceptance);
  1898. typedef FWIMReleaseIsochPortProc
  1899.                                 *FWIMReleaseIsochPortProcPtr;
  1900.  
  1901. typedef OSStatus (FWIMControlIsochPortProc) (
  1902.     FWIMIsochPortControlParamsPtr
  1903.                                 pFWIMIsochPortControlParams,
  1904.     UInt32                        *pCommandAcceptance);
  1905. typedef FWIMControlIsochPortProc
  1906.                                 *FWIMControlIsochPortProcPtr;
  1907.  
  1908. typedef OSStatus (FWIMGetUniqueIDProc) (
  1909.     FWIMGetUniqueIDParamsPtr    pFWIMGetUniqueIDParams,
  1910.     UInt32                        *pCommandAcceptance);
  1911. typedef FWIMGetUniqueIDProc        *FWIMGetUniqueIDProcPtr;
  1912.  
  1913. typedef OSStatus (FWIMSetCSRROMProc) (
  1914.     FWIMSetCSRROMParamsPtr        pFWIMSetCSRROMParams,
  1915.     UInt32                        *pCommandAcceptance);
  1916. typedef FWIMSetCSRROMProc    *FWIMSetCSRROMProcPtr;
  1917.  
  1918. typedef OSStatus (FWIMDoLocalCompareSwapProc) (
  1919.     FWIMCompareSwapParamsPtr        pFWIMCompareSwapParams);
  1920. typedef FWIMDoLocalCompareSwapProc    *FWIMDoLocalCompareSwapProcPtr;
  1921.  
  1922. typedef OSStatus (FWIMSetAsynchFiltersProc) (
  1923.     FWIMSetAsynchFiltersParamsPtr    pFWIMSetAsynchFiltersParams);
  1924. typedef FWIMSetAsynchFiltersProc    *FWIMSetAsynchFiltersProcPtr;
  1925.  
  1926. typedef OSStatus (FWIMSetFWIMStateProc) (
  1927.     FWIMSetFWIMStateParamsPtr    pFWIMSetFWIMStateParams);
  1928. typedef FWIMSetFWIMStateProc    *FWIMSetFWIMStateProcPtr;
  1929.  
  1930. typedef OSStatus (FWIMGetCycleTimeProc) (
  1931.     FWIMGetCycleTimeParamsPtr    pFWIMGetCycleTimeParams);
  1932. typedef FWIMGetCycleTimeProc    *FWIMGetCycleTimeProcPtr;
  1933.  
  1934. // FWIM States. Pretty much the same values as from Driver Gestalt in Designing PCI Cards and Drivers.
  1935. // Why aren't these values in DriverGestalt.h?!?
  1936. // Quiesced means "thou shalt not call the FSL no matter what. This is important if we are in the process
  1937. // of replacing it. If a FWIM can't be quiesced but is in ROM we probably can't boot from it since we need to remove
  1938. // the FWIM while replacing the FSL. If we get a page fault after that - well that's bad right?
  1939. // If the FWIM is successfully put to sleep with a kFWIMSleep request then the FWIM should not assume that
  1940. // its hardware is in a known state when waking back up again. The FWIM should completely re-initialize itself.
  1941. enum
  1942. {
  1943.     kFWIMActive                    = 0,                // Normal FWIM operating mode. Not Quiesced
  1944.     kFWIMStandby                = 1,                // Minimal energy saving, active in 5 sec. Not Quiesced
  1945.     kFWIMIdle                    = 2,                // Substantial energy saving, active in 15 sec. Quiesced.
  1946.     kFWIMSleep                    = 3                    // Maximum savings, system hardware may be subsequently turned off, Quiesced.
  1947. };
  1948.  
  1949. enum
  1950. {
  1951.     kFWIMPluginVersion            = 0x00010000,        // For FSL 1.0-style FWIMs
  1952.     kFWIMPluginVersion11        = 0x00010001        // FWIM supports SetCSRROM, LocalCS, filters,
  1953.                                                     // etc., & returns feature info upon install.
  1954.                                                     // For use with FireWire Support 1.1.
  1955. };
  1956.  
  1957. // This table must be extended only at the end.  No entries may ever be deleted.
  1958.  
  1959. struct FWIMPluginDispatchTableStruct
  1960. {
  1961.     UInt32                        pluginVersion;
  1962.     FWIMInitializeProcPtr        fwimInitializeProc;        // Proc that initializes the FWIM.
  1963.     FWIMFinalizeProcPtr            fwimFinalizeProc;        // Proc that finalizes the FWIM.
  1964.     FWIMPollInterruptsProcPtr    fwimPollInterruptsProc;    // Proc that polls for interrupts.
  1965.     FWIMSendPhyPacketProcPtr    fwimSendLinkOnPacketProc;    // Proc that sends a link on packet.
  1966.     FWIMSendPhyPacketProcPtr    fwimSendPhyConfigurationPacketProc;    // Proc that sends a phy configuration packet.
  1967.     FWIMAsynchTransactionProcPtr
  1968.                                 fwimReadProc;            // Proc that performs an asynchronous read transaction.
  1969.     FWIMSendAsynchResponsePacketProcPtr
  1970.                                 fwimReadResponseProc;    // Proc that sends an asynchronous read response packet.
  1971.     FWIMAsynchTransactionProcPtr
  1972.                                 fwimWriteProc;            // Proc that performs an asynchronous write transaction.
  1973.     FWIMSendAsynchResponsePacketProcPtr
  1974.                                 fwimWriteResponseProc;    // Proc that sends an asynchronous write response packet.
  1975.     FWIMAsynchTransactionProcPtr
  1976.                                 fwimLockProc;            // Proc that performs an asynchronous lock transaction.
  1977.     FWIMSendAsynchResponsePacketProcPtr
  1978.                                 fwimLockResponseProc;    // Proc that sends an asynchronous lock response packet.
  1979.     FWIMAllocateIsochPortProcPtr
  1980.                                 fwimAllocateIsochPortProc;    // Proc that allocates an isochronous port.
  1981.     FWIMReleaseIsochPortProcPtr    fwimReleaseIsochPortProc;    // Proc that releases an isochronous port.
  1982.     FWIMControlIsochPortProcPtr    fwimStartIsochPortProc;    // Proc that starts an isochronous port.
  1983.     FWIMControlIsochPortProcPtr    fwimStopIsochPortProc;    // Proc that stops an isochronous port.
  1984.     FWIMCommandProcPtr            fwimResetBusProc;        // Proc that initiates a FireWire bus reset.
  1985.     FWIMCommandProcPtr            fwimSetContenderBitProc;    // Proc that sets the contender bit.
  1986.     FWIMCommandProcPtr            fwimClearContenderBitProc;    // Proc that clears the contender bit.
  1987.     FWIMCommandProcPtr            fwimEnableCycleMasterProc;    // Proc that enables cycle mastering.
  1988.     FWIMCommandProcPtr            fwimDisableCycleMasterProc;    // Proc that disables cycle mastering.
  1989.     FWIMCommandProcPtr            fwimSetRootHoldoffBitProc;    // Proc that sets the root holdoff bit.
  1990.     FWIMCommandProcPtr            fwimClearRootHoldoffBitProc;    // Proc that clears the root holdoff bit.
  1991.     FWIMGetUniqueIDProcPtr        fwimGetUniqueIDProc;    // Proc that returns local unique ID.
  1992.     FWIMSetCSRROMProcPtr        fwimSetCSRROMProc;        // Proc that sets CSR ROM.
  1993.     FWIMDoLocalCompareSwapProcPtr    fwimDoLocalCompareSwapProc;    // Proc for hardware CS (OHCI IRM)
  1994.     FWIMSetAsynchFiltersProcPtr    fwimSetAsynchFiltersProc;    // Proc to set asynch and DMA filters
  1995.     FWIMSetFWIMStateProcPtr        fwimSetFWIMStateProc;    // Proc to put FWIM to sleep and/or quiesce it for replacement
  1996.     FWIMGetCycleTimeProcPtr        fwimGetCycleTimeProc;    // Proc to read cycle timer.
  1997. };
  1998. typedef struct FWIMPluginDispatchTableStruct
  1999.                                 FWIMPluginDispatchTable,
  2000.                                 *FWIMPluginDispatchTablePtr;
  2001.  
  2002. typedef struct FWIMProcessParamsStruct
  2003.                                 FWIMProcessParams,
  2004.                                 *FWIMProcessParamsPtr;
  2005.  
  2006. typedef void    (FWIMProcessCompletionProc) (
  2007.     FWIMProcessParamsPtr        pFWIMProcessParams);
  2008. typedef FWIMProcessCompletionProc
  2009.                                 *FWIMProcessCompletionProcPtr;
  2010.  
  2011. struct FWIMProcessParamsStruct
  2012. {
  2013.     FWIMProcessParamsPtr        pNextFWIMProcessParams;    // Link to next set of params.
  2014.     UInt32                        processType;            // Type of processing.
  2015.     FWIMID                        fwimID;                    // Reference to calling FWIM.
  2016.     UInt32                        processFlags;            // Flag bits to control processing.
  2017.     UInt32                        processState;            // State bits of processing.
  2018.     UInt32                        processStatus;            // Final status of processing.
  2019.     FWIMProcessID                fwimProcessID;            // ID for this process.
  2020.     FWIMProcessCompletionProcPtr
  2021.                                 completionProc;            // Proc to call upon completion of processing.
  2022.     UInt32                        completionProcData;        // Data provided and used by caller.
  2023. };
  2024.  
  2025. struct FWIMProcessSelfIDsParamsStruct
  2026. {
  2027.     FWIMProcessParams            fwimProcessParams;        // Common processing params.
  2028.     UInt32                        generation;                // Bus generation of these self IDs.
  2029.     Ptr                            pSelfIDList;            // List of self IDs.
  2030.     UInt32                        selfIDListSize;            // Size of above list in bytes.
  2031.     Ptr                            pLocalSelfID;            // Local self ID if not included in above list.
  2032.     UInt32                        localSelfIDSize;        // Size of local self ID.
  2033.     UInt32                        processSelfIDsFlags;    // Flags controlling self ID processing.
  2034. };
  2035. typedef struct FWIMProcessSelfIDsParamsStruct
  2036.                                 FWIMProcessSelfIDsParams,
  2037.                                 *FWIMProcessSelfIDsParamsPtr;
  2038.  
  2039. enum
  2040. {
  2041.     kFWTransactionStatusAckCode            = FWBitRange (28, 31),
  2042.     kFWTransactionStatusAckCodePhase    = FWBitRangePhase (28, 31),
  2043.     kFWTransactionStatusSpeed            = FWBitRange (26, 27),
  2044.     kFWTransactionStatusSpeedPhase        = FWBitRangePhase (26, 27)
  2045. };
  2046.  
  2047. struct FWIMProcessAsynchParamsStruct
  2048. {
  2049.     FWIMProcessParams            fwimProcessParams;        // Common processing params.
  2050.     AbsoluteTime                timeStamp;                // Time stamp marking arrival time of packet.
  2051.     UInt32                        generation;                // Topology map generation number when packet was received.
  2052.     Ptr                            receiveBuffer;            // Buffer for data that we receive.
  2053.     UInt16                        destinationID;            // ID of destination node.
  2054.     UInt16                        transactionDescriptor;    // Descriptor for transaction.
  2055.     UInt16                        sourceID;                // ID of source node.
  2056.     UInt16                        addressHi;                // Destination address.
  2057.     UInt32                        addressLo;
  2058.     UInt16                        length;                    // Length of transaction.
  2059.     UInt16                        extendedTCode;            // Extended transaction code.
  2060.     UInt32                        transactionStatus;        // Status of transaction.
  2061. };
  2062. typedef struct FWIMProcessAsynchParamsStruct
  2063.                                 FWIMProcessAsynchParams,
  2064.                                 *FWIMProcessAsynchParamsPtr;
  2065.  
  2066.  
  2067. ////////////////////////////////////////////////////////////////////////////////
  2068. //
  2069. // FireWire virtual device defs.
  2070. //
  2071.  
  2072. /*zzz should be in VirtualDevice.h */
  2073. //zzz support multiple bus vdev??? (FW and SCSI vdev?)
  2074. //
  2075.  
  2076. enum
  2077. {
  2078.     kVDeviceDescriptionSignature
  2079.                                 = 'vdei'                // Virtual Device Export Information
  2080. };
  2081.  
  2082. enum
  2083. {
  2084.     kVDeviceDescriptionVersion    = 0x00010000
  2085. };
  2086.  
  2087. struct VDeviceDescriptionStruct
  2088. {
  2089.     OSType                        vDeviceDescSignature;    // Virtual Device Description signature.
  2090.     UInt32                        vDeviceDescVersion;        // Virtual Device Description version.
  2091.     UInt32                        vDeviceDescSize;        // Total size of this description.
  2092.     OSType                        vDeviceServiceCategory;    // Service category of family providing interface to this
  2093.                                                         // virtual device.
  2094. };
  2095. typedef struct VDeviceDescriptionStruct
  2096.                                 VDeviceDescription,
  2097.                                 *VDeviceDescriptionPtr;
  2098.  
  2099. struct FWVDeviceDescriptionStruct
  2100. {
  2101.     VDeviceDescription            vDeviceDescription;        // Universal Virtual Device description.
  2102.     UInt32                        unitSpecID;                // Unit Spec ID to present in unit directory (24-bit).
  2103.     UInt32                        unitSWVersion;            // Unit SW version to present in unit directory (24-bit).
  2104. };
  2105. typedef struct FWVDeviceDescriptionStruct
  2106.                                 FWVDeviceDescription,
  2107.                                 *FWVDeviceDescriptionPtr;
  2108.  
  2109. /*zzz*/
  2110.  
  2111. // Define FW virtual device proc names.
  2112. #define FWVDeviceInstallProcPascalName "\pFWVDeviceInstall"
  2113. #define FWVDeviceInterfaceProcPascalName "\pFWVDeviceInterface"
  2114.  
  2115. struct FWVDeviceInstallParamsStruct
  2116. {
  2117.     Ptr                            fwVDeviceSpecificData;    // Data specific to virtual device.
  2118.     FWVDeviceID                    fwVDeviceID;            // ID for this virtual device.
  2119.     CSRROMEntryID                fwVDeviceCSRROMUnitDirID;    // ID of the virtual device's CSR ROM unit directory.
  2120. };
  2121. typedef struct FWVDeviceInstallParamsStruct
  2122.                                 FWVDeviceInstallParams,
  2123.                                 *FWVDeviceInstallParamsPtr;
  2124.  
  2125. typedef OSStatus
  2126.     (FWVDeviceInstallProc) (
  2127.         FWVDeviceInstallParamsPtr    pFWVDeviceInstallParams);
  2128. typedef FWVDeviceInstallProc    *FWVDeviceInstallProcPtr;
  2129.  
  2130.  
  2131. ////////////////////////////////////////////////////////////////////////////////
  2132. //
  2133. // FireWire protocol driver defs.
  2134. //
  2135.  
  2136. enum
  2137. {
  2138.     kFWPDriverFileType            = 'ndrv'
  2139. };
  2140.  
  2141. enum
  2142. {
  2143.     kTheFWPDriverDescriptionSignature
  2144.                                 = 'pdei'
  2145. };
  2146.  
  2147. enum
  2148. {
  2149.     kInitialFWPDriverDescriptor    = 0
  2150. };
  2151.  
  2152. typedef UInt32    FWPDriverDescVersion;
  2153. typedef OptionBits    FWPDriverLoadingOptions;
  2154.  
  2155. typedef OSStatus    (FWPDriverUnitAddedProc) (
  2156.     FWPDriverID                    fwPDriverID,
  2157.     UInt32                        fwPDriverSpecificData,
  2158.     FWUnitID                    fwUnitID);
  2159. typedef FWPDriverUnitAddedProc
  2160.                                 *FWPDriverUnitAddedProcPtr;
  2161.  
  2162. typedef OSStatus    (FWPDriverUnitRemovedProc) (
  2163.     FWPDriverID                    fwPDriverID,
  2164.     UInt32                        fwPDriverSpecificData,
  2165.     FWUnitID                    fwUnitID);
  2166. typedef FWPDriverUnitRemovedProc
  2167.                                 *FWPDriverUnitRemovedProcPtr;
  2168.  
  2169. struct FWPDriverProtocolStruct
  2170. {
  2171.     UInt32                        specID;                    // IDs specifying protocol.
  2172.     UInt32                        swVersion;
  2173. };
  2174. typedef struct FWPDriverProtocolStruct
  2175.                                 FWPDriverProtocol,
  2176.                                 *FWPDriverProtocolPtr;
  2177.  
  2178. struct FWPDriverTypeStruct
  2179. {
  2180.     OSType                        fwPDriverServiceCategory;    // Service category that this protocol driver communicates over.
  2181.     NumVersion                    fwPDriverVersion;            // Protocol driver version number.
  2182. };
  2183. typedef struct FWPDriverTypeStruct
  2184.                                 FWPDriverType,
  2185.                                 *FWPDriverTypePtr;
  2186.  
  2187. struct FWPDriverLoadingInfoStruct
  2188. {
  2189.     FWPDriverLoadingOptions        fwPDriverLoadingOptions;    // Options for protocol driver loading.
  2190.     Str31                        fwPDriverName;            // Protocol driver's name when loading into the Name Registry.
  2191. };
  2192. typedef struct FWPDriverLoadingInfoStruct
  2193.                                 FWPDriverLoadingInfo,
  2194.                                 *FWPDriverLoadingInfoPtr;
  2195.  
  2196. struct FWPDriverDescriptionStruct
  2197. {
  2198.     OSType                        fwPDriverDescSignature;    // Signature field of this structure.
  2199.     FWPDriverDescVersion        fwPDriverDescVersion;    // Version of this data structure.
  2200.     FWPDriverType                fwPDriverType;            // Type of protocol driver.
  2201.     FWPDriverLoadingInfo        fwPDriverLoadingInfo;    // Loading information for protocol driver.
  2202. };
  2203. typedef struct FWPDriverDescriptionStruct
  2204.                                 FWPDriverDescription,
  2205.                                 *FWPDriverDescriptionPtr;
  2206.  
  2207.  
  2208. ////////////////////////////////////////////////////////////////////////////////
  2209. //
  2210. // FireWire Services defs.
  2211. //
  2212.  
  2213. // FireWire Services constants.
  2214.  
  2215. enum
  2216. {
  2217.     kFWCommandWaiting            = 1,
  2218.     kFWCommandBusy                = 2,
  2219.     kFWCommandComplete            = 3
  2220. };
  2221.  
  2222. enum
  2223. {
  2224.     kFWCommandSyncFlag            = (1 << 0),                // Perform command synchronously.
  2225.     kFWCommandPriorityFlag        = (1 << 1),                // This is a priority command.
  2226.     kFWCommandSynchronizeFlag    = (1 << 2),                // Wait for this command to complete before starting
  2227.                                                         // subsequent commands.
  2228.     kFWCommandImmediateFlag        = (1 << 3)                // Perform command immediately.
  2229. };
  2230.  
  2231. enum
  2232. {
  2233.     kInvalidFWNodeID            = 0x7FFFFFFF,
  2234.     kInvalidFWGenerationNumber    = 0x7FFFFFFF
  2235. };
  2236.  
  2237. enum
  2238. {
  2239.     kIsochChannelActiveBit        = (1 << 0),                // Isochronous channel is active.
  2240.     kIsochChannelInitializedBit    = (1 << 1),                // Isochronous channel has been initialized.
  2241.     kIsochChannelBandwidthAllocatedBit    = (1 << 2),        // Bandwidth has been allocated for isochronous channel.
  2242.     kIsochChannelChannelAllocatedBit    = (1 << 3),        // Channel number has been allocated for isochronous channel.
  2243.     kIsochChannelAllocateOnResetBit        = (1 << 4)        // Resources must be reallocated on bus reset.
  2244. };
  2245.  
  2246. enum
  2247. {
  2248.     kInvalidFWChannelNum        = 0x7FFFFFFF
  2249. };
  2250.  
  2251.  
  2252. // Define FireWire service interface selectors.
  2253.  
  2254. enum
  2255. {
  2256.     kFWRead                        = 1,                    // Perform a read across the bus.
  2257.     kFWWrite                    = 2,                    // Perform a write across the bus.
  2258.     kFWCompareAndSwap            = 3,                    // Perform a write across the bus.
  2259.     kFWSendFCPCommand            = 4,                    // Send an FCP command and wait for response.
  2260.     kFWResetBus                    = 5,                    // Reset the FireWire bus.
  2261.     kFWBitAnd                    = 6,                    // Perform an atomic bitwise and.
  2262.     kFWBitOr                    = 7,                    // Perform an atomic bitwise or.
  2263.     kFWBitXor                    = 8,                    // Perform an atomic bitwise xor.
  2264.     kFWIncrement                = 9,                    // Perform an atomic increment.
  2265.     kFWDecrement                = 10,                    // Perform an atomic decrement.
  2266.     kFWAdd                        = 11,                    // Perform an atomic add.
  2267.     kFWThresholdAdd                = 12,                    // Perform an atomic threshold add.
  2268.     kFWThresholdSubtract        = 13,                    // Perform an atomic threshold subtract.
  2269.     kFWClippedAdd                = 14,                    // Perform an atomic clipped add.
  2270.     kFWClippedSubtract            = 15,                    // Perform an atomic clipped subtract.
  2271.     kFWInitializeIsochronousChannel    = 16,                // Initialize an isochronous channel.
  2272.     kFWReleaseIsochronousChannel    = 17,                // Release an isochronous channel.
  2273.     kFWStartIsochronousChannel        = 18,                // Start an isochronous channel.
  2274.     kFWStopIsochronousChannel        = 19,                // Stop an isochronous channel.
  2275.     kFWAllocateLocalIsochronousPort    = 20,                // Allocate a local isochronous port.
  2276.     kFWReleaseLocalIsochronousPort    = 21,                // Release a local isochronous port.
  2277.     kFWStartLocalIsochronousPort    = 22,                // Start a local isochronous port.
  2278.     kFWStopLocalIsochronousPort        = 23,                // Stop a local isochronous port.
  2279.     kFWSBP2Login                    = 24,                //   Serial Bus Protocol 2 API is
  2280.     kFWSBP2Logout                    = 25,                //   Just these four calls.
  2281.     kFWSBP2Append                    = 26,
  2282.     kFWSBP2Manage                    = 27,
  2283.     kFWChangePower                    = 28
  2284. };
  2285.  
  2286. enum
  2287. {
  2288.     kFWBasicCommandObjectType            = 1,            // Type of FireWire command object for basic commands.
  2289.     kFWAsynchCommandObjectType            = 2,            // Type of FireWire command object for asynchronous transaction commands.
  2290.     kFWIsochChannelCommandObjectType    = 3,            // Type of FireWire command object for isoch channel commands.
  2291.     kFWIsochPortCommandObjectType        = 4,            // Type of FireWire command object for isoch port commands.
  2292.     kFWFCPCommandObjectType                = 5,            // Type of FireWire command object for FCP commands.
  2293.     kFWSBP2LoginCommandObjectType        = 6,            // For SBP-2 logins
  2294.     kFWSBP2NormalCommandObjectType        = 7,            // For SBP-2 Normal Command ORBs
  2295.     kFWSBP2ManagementCommandObjectType    = 8,            // For SBP-2 miscellaneous
  2296.     kFWPowerCommandObjectType            = 9
  2297. };
  2298.  
  2299. // Flags for asynchronous command objects
  2300.  
  2301. enum
  2302. {
  2303.     kFWAsynchOverrideMaxPayload    = (1 << 0),                // Override max payload transfer flag.
  2304.     kFWAsynchDisableAddressIncrement
  2305.                                 = (1 << 1),                // Disable auto incrementing of target addresses.
  2306.     kFWAsynchAbsoluteAddress    = (1 << 2),                // Use full 64-bit address.
  2307.     kFWAsynchFailOnBusReset        = (1 << 3),                // Fail asynchronous command if a bus reset occurs.
  2308.     kFWAsynchOverrideSpeed        = (1 << 4)                // Use client-specified speed no matter what.
  2309. };
  2310.  
  2311. // Flags for power command objects
  2312.  
  2313. enum
  2314. {
  2315.     kFWImpossiblePowerRequest    = (1 << 0),                // Set by FWChangePower
  2316.     kFWCanReducePowerOnRequest    = (1 << 1),                // Driver willing to spin-down, etc.
  2317.     kFWNotifyWhenPowerAvailable    = (1 << 2)                // Driver willing to try again later
  2318. };
  2319.  
  2320. // Event codes for cable power notification events
  2321.  
  2322. enum
  2323. {
  2324.     kFWCablePowerMayBeAvailable    = 1,                    // Power requested earlier might be available
  2325.     kFWCablePowerDownRequest    = 2,                    // Please reduce consumption if possible
  2326.     kFWCablePowerOffRequest        = 3,                    // Please agree to zero power on bus
  2327.     kFWCablePowerOffNotify        = 4,                    // Power is going down - be ready or else
  2328.     kFWCablePowerFailNotify        = 5                        // Power was lost unexpectedly
  2329. };
  2330.  
  2331. // FireWire service request type defs.
  2332.  
  2333. typedef void    (FWCommandCompletionProc) (
  2334.     FWCommandObjectID            fwCommandObjectID,
  2335.     OSStatus                    commandStatus,
  2336.     UInt32                        completionProcData);
  2337. typedef FWCommandCompletionProc    *FWCommandCompletionProcPtr;
  2338.  
  2339. enum
  2340. {
  2341.     kResponseDoneStatus            = 0,
  2342.     kResponseContinueStatus        = 1,
  2343.     kResponseUnrecognizedStatus    = 2
  2344. };
  2345.  
  2346. typedef UInt32    (FCPResponseHandler) (
  2347.     FWCommandObjectID            fwCommandObjectID,
  2348.     Ptr                            responseBuffer,
  2349.     UInt32                        responseLength);
  2350. typedef FCPResponseHandler        *FCPResponseHandlerPtr;
  2351.  
  2352. struct FWAddressStruct
  2353. {
  2354.     UInt32                        addressHi,
  2355.                                 addressLo;
  2356. };
  2357. typedef struct FWAddressStruct    FWAddress, *FWAddressPtr;
  2358.  
  2359.  
  2360. // FireWire Services procedure defs.
  2361.  
  2362. OSStatus    FWRegisterDriver (
  2363.     RegEntryIDPtr                pFWDriverRegEntry,
  2364.     FWDriverID                    *pFWDriverID,
  2365.     CSRROMEntryID                *pCSRUnitID,
  2366.     UInt32                        fwDriverSpecificData);
  2367.  
  2368. OSStatus    FWUnregisterDriver (
  2369.     FWDriverID                    fwDriverID);
  2370.  
  2371. OSStatus    FWRegisterProtocolDriver (
  2372.     RegEntryIDPtr                pFWPDriverRegEntry,
  2373.     FWPDriverID                    *pFWPDriverID,
  2374.     UInt32                        fwPDriverSpecificData);
  2375.  
  2376. OSStatus    FWUnregisterProtocolDriver (
  2377.     FWPDriverID                    fwPDriverID);
  2378.  
  2379. OSStatus    FWScanUnitsForFWPDriver (
  2380.     FWPDriverID                    fwPDriverID);
  2381.  
  2382. OSStatus    FWSetPDriverProtocolTable (
  2383.     FWPDriverID                    fwPDriverID,
  2384.     FWPDriverProtocolPtr        fwPDriverProtocolTable,
  2385.     UInt32                        tableSize);
  2386.  
  2387. OSStatus    FWGetPDriverProtocolTable (
  2388.     FWPDriverID                    fwPDriverID,
  2389.     FWPDriverProtocolPtr        fwPDriverProtocolTable,
  2390.     UInt32                        *pTableSize,
  2391.     UInt32                        maxTableSize);
  2392.  
  2393. OSStatus    FWSetFWPDriverUnitAddedProc (
  2394.     FWPDriverID                    fwPDriverID,
  2395.     FWPDriverUnitAddedProcPtr    fwPDriverUnitAddedProc);
  2396.  
  2397. OSStatus    FWGetFWPDriverUnitAddedProc (
  2398.     FWPDriverID                    fwPDriverID,
  2399.     FWPDriverUnitAddedProcPtr    *pFWPDriverUnitAddedProc);
  2400.  
  2401. OSStatus    FWSetFWPDriverUnitRemovedProc (
  2402.     FWPDriverID                    fwPDriverID,
  2403.     FWPDriverUnitRemovedProcPtr    fwPDriverUnitRemovedProc);
  2404.  
  2405. OSStatus    FWGetFWPDriverUnitRemovedProc (
  2406.     FWPDriverID                    fwPDriverID,
  2407.     FWPDriverUnitRemovedProcPtr    *pFWPDriverUnitRemovedProc);
  2408.  
  2409. OSStatus    FWRegisterFSSpecPDriver (
  2410.     FSSpecPtr                    pFWPDriverFSSpec);
  2411.  
  2412. OSStatus    FWRegisterFSSpecResourcePDriver (
  2413.     FSSpecPtr                    pFWPDriverFSSpec,
  2414.     ResType                        fwPDriverResType,
  2415.     short                        fwPDriverResID);
  2416.  
  2417. OSStatus    FWAddUnitConnection (
  2418.     FWUnitID                    fwUnitID,
  2419.     FWReferenceID                fwReferenceID);
  2420.  
  2421. OSStatus    FWRemoveUnitConnection (
  2422.     FWUnitID                    fwUnitID,
  2423.     FWReferenceID                fwReferenceID);
  2424.  
  2425. OSStatus    FWSetFWClientResetNotifyProc (
  2426.     FWReferenceID                fwReferenceID,
  2427.     FWClientResetNotifyProcPtr    fwClientResetNotifyProc);
  2428.  
  2429. OSStatus    FWGetFWClientResetNotifyProc (
  2430.     FWReferenceID                fwReferenceID,
  2431.     FWClientResetNotifyProcPtr    *pFWClientResetNotifyProc);
  2432.  
  2433. OSStatus    FWSetFWClientBusManagementNotifyProc (
  2434.     FWReferenceID                fwReferenceID,
  2435.     FWClientResetNotifyProcPtr    fwClientResetNotifyProc);
  2436.  
  2437. OSStatus    FWGetFWClientBusManagementNotifyProc (
  2438.     FWReferenceID                fwReferenceID,
  2439.     FWClientResetNotifyProcPtr    *pFWClientResetNotifyProc);
  2440.  
  2441. OSStatus    FWSetFWClientReadRequestProc (
  2442.     FWReferenceID                fwReferenceID,
  2443.     FWClientReadProcPtr            fwClientReadRequestProc);
  2444.  
  2445. OSStatus    FWGetFWClientReadRequestProc (
  2446.     FWReferenceID                fwReferenceID,
  2447.     FWClientReadProcPtr            *pFWClientReadRequestProc);
  2448.  
  2449. OSStatus    FWSetFWClientReadCompleteProc (
  2450.     FWReferenceID                fwReferenceID,
  2451.     FWClientReadProcPtr            fwClientReadCompleteProc);
  2452.  
  2453. OSStatus    FWGetFWClientReadCompleteProc (
  2454.     FWReferenceID                fwReferenceID,
  2455.     FWClientReadProcPtr            *pFWClientReadCompleteProc);
  2456.  
  2457. OSStatus    FWSetFWClientWriteRequestProc (
  2458.     FWReferenceID                fwReferenceID,
  2459.     FWClientWriteProcPtr        fwClientWriteRequestProc);
  2460.  
  2461. OSStatus    FWGetFWClientWriteRequestProc (
  2462.     FWReferenceID                fwReferenceID,
  2463.     FWClientWriteProcPtr        *pFWClientWriteRequestProc);
  2464.  
  2465. OSStatus    FWSetFWClientWriteCompleteProc (
  2466.     FWReferenceID                fwReferenceID,
  2467.     FWClientWriteProcPtr        fwClientWriteCompleteProc);
  2468.  
  2469. OSStatus    FWGetFWClientWriteCompleteProc (
  2470.     FWReferenceID                fwReferenceID,
  2471.     FWClientWriteProcPtr        *pFWClientWriteCompleteProc);
  2472.  
  2473. OSStatus    FWSetFWClientLockRequestProc (
  2474.     FWReferenceID                fwReferenceID,
  2475.     FWClientLockProcPtr            fwClientLockRequestProc);
  2476.  
  2477. OSStatus    FWGetFWClientLockRequestProc (
  2478.     FWReferenceID                fwReferenceID,
  2479.     FWClientLockProcPtr            *pFWClientLockRequestProc);
  2480.  
  2481. OSStatus    FWSetFWClientLockCompleteProc (
  2482.     FWReferenceID                fwReferenceID,
  2483.     FWClientLockProcPtr            fwClientLockCompleteProc);
  2484.  
  2485. OSStatus    FWGetFWClientLockCompleteProc (
  2486.     FWReferenceID                fwReferenceID,
  2487.     FWClientLockProcPtr            *pFWClientLockCompleteProc);
  2488.  
  2489. OSStatus    FWSetFWClientInitIsochPortProc (
  2490.     FWReferenceID                fwReferenceID,
  2491.     FWClientInitIsochPortProcPtr
  2492.                                 fwClientInitIsochPortProc);
  2493.  
  2494. OSStatus    FWGetFWClientInitIsochPortProc (
  2495.     FWReferenceID                fwReferenceID,
  2496.     FWClientInitIsochPortProcPtr
  2497.                                 *pFWClientInitIsochPortProc);
  2498.  
  2499. OSStatus    FWSetFWClientReleaseIsochPortProc (
  2500.     FWReferenceID                fwReferenceID,
  2501.     FWClientReleaseIsochPortProcPtr
  2502.                                 fwClientReleaseIsochPortProc);
  2503.  
  2504. OSStatus    FWGetFWClientReleaseIsochPortProc (
  2505.     FWReferenceID                fwReferenceID,
  2506.     FWClientReleaseIsochPortProcPtr
  2507.                                 *pFWClientReleaseIsochPortProc);
  2508.  
  2509. OSStatus    FWSetFWClientStartIsochPortProc (
  2510.     FWReferenceID                fwReferenceID,
  2511.     FWClientStartIsochPortProcPtr
  2512.                                 fwClientStartIsochPortProc);
  2513.  
  2514. OSStatus    FWGetFWClientStartIsochPortProc (
  2515.     FWReferenceID                fwReferenceID,
  2516.     FWClientStartIsochPortProcPtr
  2517.                                 *pFWClientStartIsochPortProc);
  2518.  
  2519. OSStatus    FWSetFWClientStopIsochPortProc (
  2520.     FWReferenceID                fwReferenceID,
  2521.     FWClientStopIsochPortProcPtr
  2522.                                 fwClientStopIsochPortProc);
  2523.  
  2524. OSStatus    FWGetFWClientStopIsochPortProc (
  2525.     FWReferenceID                fwReferenceID,
  2526.     FWClientStopIsochPortProcPtr
  2527.                                 *pFWClientStopIsochPortProc);
  2528.  
  2529. OSStatus    FWSetFWClientPowerNotifyProc (
  2530.     FWReferenceID                fwReferenceID,
  2531.     FWClientPowerNotifyProcPtr    fwClientPowerNotifyProc);
  2532.  
  2533. OSStatus    FWGetFWClientPowerNotifyProc (
  2534.     FWReferenceID                fwReferenceID,
  2535.     FWClientPowerNotifyProcPtr    *pFWClientPowerNotifyProc);
  2536.  
  2537. TaskID    FWCurrentTaskID (void);
  2538.  
  2539. OSStatus    FWCreateSoftwareInterrupt (
  2540.     SoftwareInterruptHandler    theHandler,
  2541.     TaskID                        theTask,
  2542.     void                        *theParameter,
  2543.     Boolean                        persistent,
  2544.     SoftwareInterruptID            *theSoftwareInterrupt);
  2545.  
  2546. OSStatus    FWSendSoftwareInterrupt (
  2547.     SoftwareInterruptID            theSoftwareInterrupt,
  2548.     void                        *theParameter);
  2549.  
  2550. OSStatus    FWDeleteSoftwareInterrupt (
  2551.     SoftwareInterruptID            theSoftwareInterrupt);
  2552.  
  2553. OSStatus    FWAllocateFWCommandObject (
  2554.     FWCommandObjectID            *pFWCommandObjectID);
  2555.  
  2556. OSStatus    FWGetFWCommandObjectType (
  2557.     FWCommandObjectID            fwCommandObjectID,
  2558.     UInt32                        *pFWCommandObjectType);
  2559.  
  2560. OSStatus    FWGetFWCommandType (
  2561.     FWCommandObjectID            fwCommandObjectID,
  2562.     UInt32                        *pCommandType);
  2563.  
  2564. OSStatus    FWSetFWCommandFWReferenceID (
  2565.     FWCommandObjectID            fwCommandObjectID,
  2566.     FWReferenceID                fwReferenceID);
  2567.  
  2568. OSStatus    FWGetFWCommandFWReferenceID (
  2569.     FWCommandObjectID            fwCommandObjectID,
  2570.     FWReferenceID                *pFWReferenceID);
  2571.  
  2572. OSStatus    FWSetFWCommandFlags (
  2573.     FWCommandObjectID            fwCommandObjectID,
  2574.     UInt32                        commandFlags);
  2575.  
  2576. OSStatus    FWGetFWCommandFlags (
  2577.     FWCommandObjectID            fwCommandObjectID,
  2578.     UInt32                        *pCommandFlags);
  2579.  
  2580. OSStatus    FWGetFWCommandStatus (
  2581.     FWCommandObjectID            fwCommandObjectID,
  2582.     OSStatus                    *pCommandStatus);
  2583.  
  2584. OSStatus    FWSetFWCommandCompletionProc (
  2585.     FWCommandObjectID            fwCommandObjectID,
  2586.     FWCommandCompletionProcPtr    completionProc);
  2587.  
  2588. OSStatus    FWGetFWCommandCompletionProc (
  2589.     FWCommandObjectID            fwCommandObjectID,
  2590.     FWCommandCompletionProcPtr    *pCompletionProc);
  2591.  
  2592. OSStatus    FWSetFWCommandCompletionProcData (
  2593.     FWCommandObjectID            fwCommandObjectID,
  2594.     UInt32                        completionProcData);
  2595.  
  2596. OSStatus    FWGetFWCommandCompletionProcData (
  2597.     FWCommandObjectID            fwCommandObjectID,
  2598.     UInt32                        *pCompletionProcData);
  2599.  
  2600. OSStatus    FWSetFWCommandParams (
  2601.     FWCommandObjectID            fwCommandObjectID,
  2602.     FWReferenceID                fwReferenceID,
  2603.     UInt32                        commandFlags,
  2604.     FWCommandCompletionProcPtr    completionProc,
  2605.     UInt32                        completionProcData);
  2606.  
  2607. OSStatus    FWGetFWCommandParams (
  2608.     FWCommandObjectID            fwCommandObjectID,
  2609.     UInt32                        *pFWCommandObjectType,
  2610.     UInt32                        *pCommandType,
  2611.     FWReferenceID                *pFWReferenceID,
  2612.     UInt32                        *pCommandFlags,
  2613.     OSStatus                    *pCommandStatus,
  2614.     FWCommandCompletionProcPtr    *pCompletionProc,
  2615.     UInt32                        *pCompletionProcData);
  2616.  
  2617. OSStatus    FWDeallocateFWCommandObject (
  2618.     FWCommandObjectID            fwCommandObjectID);
  2619.  
  2620. OSStatus    FWGetTopologyMap (
  2621.     FWReferenceID                fwReferenceID,
  2622.     FWTopologyMapPtr            pFWTopologyMap);
  2623.  
  2624. OSStatus    FWAllocateAsynchCommandObject (
  2625.     FWCommandObjectID            *pFWCommandObjectID);
  2626.  
  2627. OSStatus    FWSetAsynchCommandGeneration (
  2628.     FWCommandObjectID            fwCommandObjectID,
  2629.     UInt32                        generation);
  2630.  
  2631. OSStatus    FWGetAsynchCommandGeneration (
  2632.     FWCommandObjectID            fwCommandObjectID,
  2633.     UInt32                        *pGeneration);
  2634.  
  2635. OSStatus    FWSetAsynchCommandAddress (
  2636.     FWCommandObjectID            fwCommandObjectID,
  2637.     UInt32                        addressHi,
  2638.     UInt32                        addressLo);
  2639.  
  2640. OSStatus    FWGetAsynchCommandAddress (
  2641.     FWCommandObjectID            fwCommandObjectID,
  2642.     UInt32                        *pAddressHi,
  2643.     UInt32                        *pAddressLo);
  2644.  
  2645. OSStatus    FWSetAsynchCommandBuffer (
  2646.     FWCommandObjectID            fwCommandObjectID,
  2647.     Ptr                            buffer);
  2648.  
  2649. OSStatus    FWGetAsynchCommandBuffer (
  2650.     FWCommandObjectID            fwCommandObjectID,
  2651.     Ptr                            *pBuffer);
  2652.  
  2653. OSStatus    FWSetAsynchCommandLength (
  2654.     FWCommandObjectID            fwCommandObjectID,
  2655.     UInt32                        length);
  2656.  
  2657. OSStatus    FWGetAsynchCommandLength (
  2658.     FWCommandObjectID            fwCommandObjectID,
  2659.     UInt32                        *pLength);
  2660.  
  2661. OSStatus    FWSetAsynchCommandBytesTransferred (
  2662.     FWCommandObjectID            fwCommandObjectID,
  2663.     UInt32                        bytesTransferred);
  2664.  
  2665. OSStatus    FWGetAsynchCommandBytesTransferred (
  2666.     FWCommandObjectID            fwCommandObjectID,
  2667.     UInt32                        *pBytesTransferred);
  2668.  
  2669. OSStatus    FWSetAsynchCommandMaxPayloadSize (
  2670.     FWCommandObjectID            fwCommandObjectID,
  2671.     UInt32                        maxPayloadSize);
  2672.  
  2673. OSStatus    FWGetAsynchCommandMaxPayloadSize (
  2674.     FWCommandObjectID            fwCommandObjectID,
  2675.     UInt32                        *pMaxPayloadSize);
  2676.  
  2677. OSStatus    FWSetAsynchCommandMaxRetries (
  2678.     FWCommandObjectID            fwCommandObjectID,
  2679.     UInt32                        maxRetries);
  2680.  
  2681. OSStatus    FWGetAsynchCommandMaxRetries (
  2682.     FWCommandObjectID            fwCommandObjectID,
  2683.     UInt32                        *pMaxRetries);
  2684.  
  2685. OSStatus    FWSetAsynchCommandTransferFlags (
  2686.     FWCommandObjectID            fwCommandObjectID,
  2687.     UInt32                        transferFlags);
  2688.  
  2689. OSStatus    FWGetAsynchCommandTransferFlags (
  2690.     FWCommandObjectID            fwCommandObjectID,
  2691.     UInt32                        *pTransferFlags);
  2692.  
  2693. OSStatus    FWSetAsynchCommandSpeed (
  2694.     FWCommandObjectID            fwCommandObjectID,
  2695.     UInt32                        speed);
  2696.  
  2697. OSStatus    FWGetAsynchCommandSpeed (
  2698.     FWCommandObjectID            fwCommandObjectID,
  2699.     UInt32                        *pSpeed);
  2700.  
  2701. OSStatus    FWSetAsynchCommandParams (
  2702.     FWCommandObjectID            fwCommandObjectID,
  2703.     UInt32                        generation,
  2704.     UInt32                        addressHi,
  2705.     UInt32                        addressLo,
  2706.     Ptr                            buffer,
  2707.     UInt32                        length,
  2708.     UInt32                        maxPayloadSize,
  2709.     UInt32                        maxRetries,
  2710.     UInt32                        transferFlags);
  2711.  
  2712. OSStatus    FWGetAsynchCommandParams (
  2713.     FWCommandObjectID            fwCommandObjectID,
  2714.     UInt32                        *pGeneration,
  2715.     UInt32                        *pAddressHi,
  2716.     UInt32                        *pAddressLo,
  2717.     Ptr                            *pBuffer,
  2718.     UInt32                        *pLength,
  2719.     UInt32                        *pBytesTransferred,
  2720.     UInt32                        *pMaxPayloadSize,
  2721.     UInt32                        *pMaxRetries,
  2722.     UInt32                        *pTransferFlags);
  2723.  
  2724. OSStatus    FWSetCommonAsynchCommandParams (
  2725.     FWCommandObjectID            fwCommandObjectID,
  2726.     UInt32                        addressHi,
  2727.     UInt32                        addressLo,
  2728.     Ptr                            buffer,
  2729.     UInt32                        length);
  2730.  
  2731. OSStatus    FWGetCommonAsynchCommandParams (
  2732.     FWCommandObjectID            fwCommandObjectID,
  2733.     Ptr                            *pBuffer,
  2734.     UInt32                        *pLength,
  2735.     UInt32                        *pBytesTransferred);
  2736.  
  2737. OSStatus    FWRead (
  2738.     FWCommandObjectID            fwCommandObjectID);
  2739.  
  2740. OSStatus    FWWrite (
  2741.     FWCommandObjectID            fwCommandObjectID);
  2742.  
  2743. OSStatus    FWCompareAndSwap (
  2744.     FWCommandObjectID            fwCommandObjectID);
  2745.  
  2746. OSStatus    FWBitAnd (
  2747.     FWCommandObjectID            fwCommandObjectID);
  2748.  
  2749. OSStatus    FWBitOr (
  2750.     FWCommandObjectID            fwCommandObjectID);
  2751.  
  2752. OSStatus    FWBitXor (
  2753.     FWCommandObjectID            fwCommandObjectID);
  2754.  
  2755. OSStatus    FWIncrement (
  2756.     FWCommandObjectID            fwCommandObjectID);
  2757.  
  2758. OSStatus    FWDecrement (
  2759.     FWCommandObjectID            fwCommandObjectID);
  2760.  
  2761. OSStatus    FWAdd (
  2762.     FWCommandObjectID            fwCommandObjectID);
  2763.  
  2764. OSStatus    FWThresholdAdd (
  2765.     FWCommandObjectID            fwCommandObjectID);
  2766.  
  2767. OSStatus    FWThresholdSubtract (
  2768.     FWCommandObjectID            fwCommandObjectID);
  2769.  
  2770. OSStatus    FWClippedAdd (
  2771.     FWCommandObjectID            fwCommandObjectID);
  2772.  
  2773. OSStatus    FWClippedSubtract (
  2774.     FWCommandObjectID            fwCommandObjectID);
  2775.  
  2776. OSStatus    FWSendFCPCommand (
  2777.     FWCommandObjectID            fwCommandObjectID);
  2778.  
  2779. OSStatus    FWAllocateFCPCommandObject (
  2780.     FWCommandObjectID            *pFWCommandObjectID);
  2781.  
  2782. OSStatus    FWSetFCPCommandCommandBuffer (
  2783.     FWCommandObjectID            fwCommandObjectID,
  2784.     Ptr                            commandBuffer);
  2785.  
  2786. OSStatus    FWGetFCPCommandCommandBuffer (
  2787.     FWCommandObjectID            fwCommandObjectID,
  2788.     Ptr                            *pCommandBuffer);
  2789.  
  2790. OSStatus    FWSetFCPCommandCommandLength (
  2791.     FWCommandObjectID            fwCommandObjectID,
  2792.     UInt32                        commandLength);
  2793.  
  2794. OSStatus    FWGetFCPCommandCommandLength (
  2795.     FWCommandObjectID            fwCommandObjectID,
  2796.     UInt32                        *pCommandLength);
  2797.  
  2798. OSStatus    FWSetFCPCommandResponseBuffer (
  2799.     FWCommandObjectID            fwCommandObjectID,
  2800.     Ptr                            responseBuffer);
  2801.  
  2802. OSStatus    FWGetFCPCommandResponseBuffer (
  2803.     FWCommandObjectID            fwCommandObjectID,
  2804.     Ptr                            *pResponseBuffer);
  2805.  
  2806. OSStatus    FWSetFCPCommandResponseBufferSize (
  2807.     FWCommandObjectID            fwCommandObjectID,
  2808.     UInt32                        responseBufferSize);
  2809.  
  2810. OSStatus    FWGetFCPCommandResponseBufferSize (
  2811.     FWCommandObjectID            fwCommandObjectID,
  2812.     UInt32                        *pResponseBufferSize);
  2813.  
  2814. OSStatus    FWSetFCPCommandResponseLength (
  2815.     FWCommandObjectID            fwCommandObjectID,
  2816.     UInt32                        responseLength);
  2817.  
  2818. OSStatus    FWGetFCPCommandResponseLength (
  2819.     FWCommandObjectID            fwCommandObjectID,
  2820.     UInt32                        *pResponseLength);
  2821.  
  2822. OSStatus    FWSetFCPCommandTimeout (
  2823.     FWCommandObjectID            fwCommandObjectID,
  2824.     Duration                    timeout);
  2825.  
  2826. OSStatus    FWGetFCPCommandTimeout (
  2827.     FWCommandObjectID            fwCommandObjectID,
  2828.     Duration                    *pTimeout);
  2829.  
  2830. OSStatus    FWSetFCPCommandMaxRetries (
  2831.     FWCommandObjectID            fwCommandObjectID,
  2832.     UInt32                        maxRetries);
  2833.  
  2834. OSStatus    FWGetFCPCommandMaxRetries (
  2835.     FWCommandObjectID            fwCommandObjectID,
  2836.     UInt32                        *pMaxRetries);
  2837.  
  2838. OSStatus    FWSetFCPCommandTransferFlags (
  2839.     FWCommandObjectID            fwCommandObjectID,
  2840.     UInt32                        transferFlags);
  2841.  
  2842. OSStatus    FWGetFCPCommandTransferFlags (
  2843.     FWCommandObjectID            fwCommandObjectID,
  2844.     UInt32                        *pTransferFlags);
  2845.  
  2846. OSStatus    FWSetFCPCommandResponseHandler (
  2847.     FWCommandObjectID            fwCommandObjectID,
  2848.     FCPResponseHandlerPtr        fcpResponseHandler);
  2849.  
  2850. OSStatus    FWGetFCPCommandResponseHandler (
  2851.     FWCommandObjectID            fwCommandObjectID,
  2852.     FCPResponseHandlerPtr        *pFCPResponseHandler);
  2853.  
  2854. OSStatus    FWSetFCPCommandParams (
  2855.     FWCommandObjectID            fwCommandObjectID,
  2856.     Ptr                            commandBuffer,
  2857.     UInt32                        commandLength,
  2858.     Ptr                            responseBuffer,
  2859.     UInt32                        responseBufferSize,
  2860.     Duration                    timeout,
  2861.     UInt32                        maxRetries,
  2862.     UInt32                        transferFlags,
  2863.     FCPResponseHandlerPtr        fcpResponseHandler);
  2864.  
  2865. OSStatus    FWGetFCPCommandParams (
  2866.     FWCommandObjectID            fwCommandObjectID,
  2867.     Ptr                            *pCommandBuffer,
  2868.     UInt32                        *pCommandLength,
  2869.     Ptr                            *pResponseBuffer,
  2870.     UInt32                        *pResponseBufferSize,
  2871.     UInt32                        *pResponseLength,
  2872.     Duration                    *pTimeout,
  2873.     UInt32                        *pMaxRetries,
  2874.     UInt32                        *pTransferFlags,
  2875.     FCPResponseHandlerPtr        *pFCPResponseHandler);
  2876.  
  2877. OSStatus    FWResetBus (
  2878.     FWCommandObjectID            fwCommandObjectID);
  2879.  
  2880. OSStatus    FWAllocateIsochronousChannelID (
  2881.     IsochChannelID                *pIsochChannelID,
  2882.     Boolean                        doIRMAllocation,
  2883.     UInt32                        bandwidth,
  2884.     UInt32                        preferredSpeed);
  2885.  
  2886. OSStatus    FWDeallocateIsochronousChannelID (
  2887.     IsochChannelID                isochChannelID);
  2888.  
  2889. OSStatus    FWAddIsochronousChannelClient (
  2890.     IsochChannelID                isochChannelID,
  2891.     FWReferenceID                fwReferenceID,
  2892.     UInt32                        refCon,
  2893.     Boolean                        clientIsTalker);
  2894.  
  2895. OSStatus    FWSetIsochChannelForceStopNotificationProc (
  2896.     IsochChannelID                isochChannelID,
  2897.     FWIsochChannelForceStopNotificationProcPtr
  2898.                                 fwIsochChannelForceStopNotificationProc);
  2899.  
  2900. OSStatus    FWInitializeIsochronousChannel (
  2901.     FWCommandObjectID            fwCommandObjectID);
  2902.  
  2903. OSStatus    FWReleaseIsochronousChannel (
  2904.     FWCommandObjectID            fwCommandObjectID);
  2905.  
  2906. OSStatus    FWStartIsochronousChannel (
  2907.     FWCommandObjectID            fwCommandObjectID);
  2908.  
  2909. OSStatus    FWStopIsochronousChannel (
  2910.     FWCommandObjectID            fwCommandObjectID);
  2911.  
  2912. OSStatus    FWAllocateIsochChannelCommandObject (
  2913.     FWCommandObjectID            *pFWCommandObjectID);
  2914.  
  2915. OSStatus    FWSetIsochChannelCommandIsochChannelID (
  2916.     FWCommandObjectID            fwCommandObjectID,
  2917.     IsochChannelID                isochChannelID);
  2918.  
  2919. OSStatus    FWGetIsochChannelCommandIsochChannelID (
  2920.     FWCommandObjectID            fwCommandObjectID,
  2921.     IsochChannelID                *pIsochChannelID);
  2922.  
  2923. OSStatus    FWCreateDCLProgram (
  2924.     DCLProgramID                *pDCLProgramID);
  2925.  
  2926. OSStatus    FWDisposeDCLProgram (
  2927.     DCLProgramID                dclProgramID);
  2928.  
  2929. OSStatus    FWSetDCLProgramStart (
  2930.     DCLProgramID                dclProgramID,
  2931.     DCLCommandPtr                pDCLStart);
  2932.  
  2933. OSStatus    FWGetDCLProgramStart (
  2934.     DCLProgramID                dclProgramID,
  2935.     DCLCommandPtr                *ppDCLStart);
  2936.  
  2937. OSStatus    FWSetDCLProgramEngineData (
  2938.     DCLProgramID                dclProgramID,
  2939.     UInt32                        dclEngineData);
  2940.  
  2941. OSStatus    FWGetDCLProgramEngineData (
  2942.     DCLProgramID                dclProgramID,
  2943.     UInt32                        *pDCLEngineData);
  2944.  
  2945. OSStatus    FWSetDCLProgramStartProc (
  2946.     DCLProgramID                dclProgramID,
  2947.     DCLProgramStartProcPtr        dclProgramStartProc);
  2948.  
  2949. OSStatus    FWGetDCLProgramStartProc (
  2950.     DCLProgramID                dclProgramID,
  2951.     DCLProgramStartProcPtr        *pDCLProgramStartProc);
  2952.  
  2953. OSStatus    FWSetDCLProgramStopProc (
  2954.     DCLProgramID                dclProgramID,
  2955.     DCLProgramStopProcPtr        dclProgramStopProc);
  2956.  
  2957. OSStatus    FWGetDCLProgramStopProc (
  2958.     DCLProgramID                dclProgramID,
  2959.     DCLProgramStopProcPtr        *pDCLProgramStopProc);
  2960.  
  2961. OSStatus    FWSetDCLProgramReleaseProc (
  2962.     DCLProgramID                dclProgramID,
  2963.     DCLProgramReleaseProcPtr    dclProgramReleaseProc);
  2964.  
  2965. OSStatus    FWGetDCLProgramReleaseProc (
  2966.     DCLProgramID                dclProgramID,
  2967.     DCLProgramReleaseProcPtr    *pDCLProgramReleaseProc);
  2968.  
  2969. OSStatus    FWSetDCLProgramCompilerNotificationProc (
  2970.     DCLProgramID                dclProgramID,
  2971.     DCLCompilerNotificationProcPtr
  2972.                                 dclCompilerNotificationProc);
  2973.  
  2974. OSStatus    FWGetDCLProgramCompilerNotificationProc (
  2975.     DCLProgramID                dclProgramID,
  2976.     DCLCompilerNotificationProcPtr
  2977.                                 *pDCLCompilerNotificationProc);
  2978.  
  2979. OSStatus    FWSetDCLProgramChannelNum (
  2980.     DCLProgramID                dclProgramID,
  2981.     UInt32                        channelNum);
  2982.  
  2983. OSStatus    FWGetDCLProgramChannelNum (
  2984.     DCLProgramID                dclProgramID,
  2985.     UInt32                        *pChannelNum);
  2986.  
  2987. OSStatus    FWSetDCLProgramTalking (
  2988.     DCLProgramID                dclProgramID,
  2989.     Boolean                        talking);
  2990.  
  2991. OSStatus    FWGetDCLProgramTalking (
  2992.     DCLProgramID                dclProgramID,
  2993.     Boolean                        *pTalking);
  2994.  
  2995. OSStatus    FWSetDCLProgramStartEvent (
  2996.     DCLProgramID                dclProgramID,
  2997.     UInt32                        startEvent,
  2998.     UInt32                        startEventState,
  2999.     UInt32                        startEventStateMask);
  3000.  
  3001. OSStatus    FWGetDCLProgramStartEvent (
  3002.     DCLProgramID                dclProgramID,
  3003.     UInt32                        *pStartEvent,
  3004.     UInt32                        *pStartEventState,
  3005.     UInt32                        *pStartEventStateMask);
  3006.  
  3007. OSStatus    FWTranslateDCLProgram (
  3008.     DCLProgramID                dclProgramID,
  3009.     DCLProgramID                *pTranslatedDCLProgramID);
  3010.  
  3011. OSStatus    FWStartDCLProgram (
  3012.     DCLProgramID                dclProgramID);
  3013.  
  3014. OSStatus    FWStopDCLProgram (
  3015.     DCLProgramID                dclProgramID);
  3016.  
  3017. OSStatus    FWReleaseDCLProgram (
  3018.     DCLProgramID                dclProgramID);
  3019.  
  3020. OSStatus    FWUpdateDCLList (
  3021.     DCLProgramID                dclProgramID,
  3022.     DCLCommandPtr                *dclCommandList,
  3023.     UInt32                        numDCLCommands);
  3024.  
  3025. OSStatus    FWModifyDCLList (
  3026.     DCLProgramID                dclProgramID,
  3027.     DCLCommandPtr                *dclCommandList,
  3028.     UInt32                        numDCLCommands);
  3029.  
  3030. OSStatus    FWModifyDCLJump (
  3031.     DCLProgramID                dclProgramID,
  3032.     DCLJumpPtr                    pDCLJump,
  3033.     DCLLabelPtr                    pDCLLabel);
  3034.  
  3035. OSStatus    FWCallDCLCallProc (
  3036.     DCLProgramID                dclProgramID,
  3037.     DCLCallProcPtr                pDCLCallProc);
  3038.  
  3039. OSStatus    FWAllocateIsochPortID (
  3040.     IsochPortID                    *pIsochPortID,
  3041.     DCLProgramID                dclProgramID,
  3042.     UInt32                        channelNum,
  3043.     UInt32                        speed,
  3044.     Boolean                        talking);
  3045.  
  3046. OSStatus    FWDeallocateIsochPortID (
  3047.     IsochPortID                    isochPortID);
  3048.  
  3049. OSStatus    FWAllocateLocalIsochronousPort (
  3050.     FWCommandObjectID            fwCommandObjectID);
  3051.  
  3052. OSStatus    FWReleaseLocalIsochronousPort (
  3053.     FWCommandObjectID            fwCommandObjectID);
  3054.  
  3055. OSStatus    FWStartLocalIsochronousPort (
  3056.     FWCommandObjectID            fwCommandObjectID);
  3057.  
  3058. OSStatus    FWStopLocalIsochronousPort (
  3059.     FWCommandObjectID            fwCommandObjectID);
  3060.  
  3061. OSStatus    FWContinueLocalIsochronousPort (
  3062.     FWCommandObjectID            fwCommandObjectID);
  3063.  
  3064. OSStatus    FWAllocateIsochPortCommandObject (
  3065.     FWCommandObjectID            *pFWCommandObjectID);
  3066.  
  3067. OSStatus    FWSetIsochPortCommandIsochPortID (
  3068.     FWCommandObjectID            fwCommandObjectID,
  3069.     IsochPortID                    isochPortID);
  3070.  
  3071. OSStatus    FWGetIsochPortCommandIsochPortID (
  3072.     FWCommandObjectID            fwCommandObjectID,
  3073.     IsochPortID                    *pIsochPortID);
  3074.  
  3075. OSStatus    FWCSRROMGetRootDirectory (
  3076.     FWReferenceID                fwReferenceID,
  3077.     CSRROMEntryID                *pCSRROMEntryID);
  3078.  
  3079. OSStatus    FWCSRROMGetEntryAddress (
  3080.     CSRROMEntryID                csrROMEntryID,
  3081.     UInt32                        *pAddress);
  3082.  
  3083. OSStatus    FWCSRROMGetEntryDataAddress (
  3084.     CSRROMEntryID                csrROMEntryID,
  3085.     UInt32                        *pAddress);
  3086.  
  3087. OSStatus    FWCSRROMCreateEntry (
  3088.     CSRROMEntryID                parentCSRROMEntryID,
  3089.     CSRROMEntryID                *pCSRROMEntryID,
  3090.     UInt32                        entryType,
  3091.     UInt32                        entryKeyValue,
  3092.     void                        *entryData,
  3093.     UInt32                        entrySize);
  3094.  
  3095. OSStatus    FWCSRROMDisposeEntry (
  3096.     CSRROMEntryID                csrROMEntryID);
  3097.  
  3098. OSStatus    FWCSRROMInstantiate (
  3099.     FWReferenceID                fwReferenceID);
  3100.  
  3101. OSStatus FWCSRROMCreateIterator (
  3102.     CSRROMEntryIterator            *pCSRROMIterator,
  3103.     FWReferenceID                fwReferenceID);
  3104.  
  3105. void FWCSRROMDisposeIterator (
  3106.     CSRROMEntryIterator            csrROMIterator);
  3107.  
  3108. OSStatus    FWCSRROMSetIterator (
  3109.     CSRROMEntryIterator            csrROMIterator,
  3110.     CSRROMEntryID                csrROMEntryID,
  3111.     CSRROMIterationOp            relationship);
  3112.  
  3113. OSStatus    FWCSRROMEntrySearch (
  3114.     CSRROMEntryIterator            csrROMIterator,
  3115.     CSRROMIterationOp            relationship,
  3116.     CSRROMEntryID                *pEntryID,
  3117.     Boolean                        *pDone,
  3118.     CSRROMSearchCriteriaPtr        pSearchCriteria,
  3119.     Ptr                            pEntryValue,
  3120.     UInt32                        *pEntrySize);
  3121.  
  3122. CSRROMEntryID    FWCSRROMCreateEntryID (void);
  3123.  
  3124. void  FWCSRROMDisposeEntryID (
  3125.     CSRROMEntryID                csrROMEntryID);
  3126.  
  3127. OSStatus    FWCSRROMCopyEntryID (
  3128.     CSRROMEntryID                srcCSRROMEntryID,
  3129.     CSRROMEntryID                *pDstCSRROMEntryID);
  3130.  
  3131. OSStatus    FWCSRROMCompareEntryIDs (
  3132.     CSRROMEntryID                csrROMEntryID1,
  3133.     CSRROMEntryID                csrROMEntryID2,
  3134.     Boolean                        *pCSRROMEntryIDsEqual);
  3135.  
  3136. void  FWCSRROMInvalidateEntryIDType (
  3137.     CSRROMEntryID                csrROMEntryID);
  3138.  
  3139. OSStatus    FWAllocateAddressSpace (
  3140.     FWAddressSpaceID            *pFWAddressSpaceID,
  3141.     FWReferenceID                fwReferenceID,
  3142.     FWAddressPtr                pFWAddress,
  3143.     UInt32                        size,
  3144.     Ptr                            addressBuffer,
  3145.     UInt32                        addressFlags,
  3146.     Ptr                            pAddressSpecificData);
  3147.  
  3148. OSStatus    FWDeallocateAddressSpace (
  3149.     FWAddressSpaceID            fwAddressSpaceID);
  3150.  
  3151. OSStatus    FWProcessReadRequest (
  3152.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  3153.  
  3154. OSStatus    FWProcessWriteRequest (
  3155.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  3156.  
  3157. OSStatus    FWProcessLockRequest (
  3158.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  3159.  
  3160. OSStatus    FWGetLocalFWReferenceIDFromFWReferenceID (
  3161.     FWReferenceID                fwReferenceID,
  3162.     FWReferenceID                *pLocalFWReferenceID);
  3163.  
  3164. OSStatus    FWGetFWDeviceIDFromFWReferenceID (
  3165.     FWReferenceID                fwReferenceID,
  3166.     FWDeviceID                    *pFWDeviceID);
  3167.  
  3168. OSStatus    FWFindFWDeviceFromNodeID (
  3169.     FWReferenceID                fwReferenceID,
  3170.     UInt32                        generation,
  3171.     UInt32                        nodeID,
  3172.     FWDeviceID                    *pFWDeviceID);
  3173.  
  3174. OSStatus    FWGetNodeID (
  3175.     FWReferenceID                fwReferenceID,
  3176.     UInt32                        *pNodeID,
  3177.     UInt32                        *pGenerationNumber);
  3178.  
  3179. OSStatus    FWGetUniqueID (
  3180.     FWReferenceID                fwReferenceID,
  3181.     CSRNodeUniqueIDPtr            pUniqueID);
  3182.  
  3183. OSStatus    FWGetUnitCSRROMEntryID (
  3184.     FWReferenceID                fwReferenceID,
  3185.     CSRROMEntryID                *pUnitCSRROMEntryID);
  3186.  
  3187. OSStatus    FWGetFWIsochResourceManagerID (
  3188.     FWReferenceID                fwReferenceID,
  3189.     FWIsochResourceManagerID    *pFWIsochResourceManagerID);
  3190.  
  3191. OSStatus    FWSetMaxPayloadSize (
  3192.     FWReferenceID                fwReferenceID,
  3193.     UInt32                        maxPayloadSize);
  3194.  
  3195. OSStatus    FWClientCommandIsComplete (
  3196.     FWClientCommandID            fwClientCommandID,
  3197.     OSStatus                    commandStatus);
  3198.  
  3199. OSStatus    FWIMCommandIsComplete (
  3200.     FWIMCommandID                fwimCommandID,
  3201.     OSStatus                    commandStatus);
  3202.  
  3203. OSStatus    FWProcessBusReset (
  3204.     FWIMID                        fwimID);
  3205.  
  3206. void    FWProcessSelfIDs (
  3207.     FWIMProcessSelfIDsParamsPtr    pFWIMProcessSelfIDsParams);
  3208.  
  3209. OSStatus    FWCreateDeferredTask (
  3210.     FWDeferredTaskID            *pFWDeferredTaskID,
  3211.     FWDeferredTaskProcPtr        fwDeferredTaskProc,
  3212.     void                        *param1);
  3213.  
  3214. OSStatus    FWDisposeDeferredTask (
  3215.     FWDeferredTaskID            fwDeferredTaskID);
  3216.  
  3217. OSStatus    FWScheduleDeferredTask (
  3218.     FWDeferredTaskID            fwDeferredTaskID,
  3219.     void                        *param2);
  3220.  
  3221. OSStatus    FWGetCycleTime (
  3222.     FWReferenceID                fwReferenceID,
  3223.     UInt32                        *pCycleTime);
  3224.  
  3225. OSStatus    FWAllocatePhysicalAddressSpace (
  3226.     FWAddressSpaceID            *pFWAddressSpaceID,
  3227.     FWReferenceID                fwReferenceID,
  3228.     IOPreparationTable            *pIOPreparationTable);
  3229.  
  3230. OSStatus    FWInstallNewFWIM (
  3231.     RegEntryIDPtr                pFWIMRegEntry);
  3232.  
  3233. OSStatus    FWAllocatePowerCommandObject(
  3234.     FWCommandObjectID            *pFWCommandObjectID);
  3235.  
  3236. OSStatus    FWSetPowerCommandParams(
  3237.     FWCommandObjectID            fwCommandObjectID,
  3238.     UInt32                        minimumDeciVolts,
  3239.     UInt32                        totalDeciWattsRequested,
  3240.     UInt32                        totalDeciWattsAllocated,
  3241.     UInt32                        powerFlags);
  3242.  
  3243. OSStatus    FWGetPowerCommandParams(
  3244.     FWCommandObjectID            fwCommandObjectID,
  3245.     UInt32                        *pMinimumDeciVolts,
  3246.     UInt32                        *pTotalDeciWattsRequested,
  3247.     UInt32                        *pTotalDeciWattsAllocated,
  3248.     UInt32                        *pPowerFlags);
  3249.  
  3250. OSStatus    FWChangePower (
  3251.     FWCommandObjectID            fwCommandObjectID);
  3252.  
  3253. void    FWWaitForDeviceRePlug(
  3254.     FWCommandObjectID            fwCommandObjectID );
  3255.  
  3256. // We need to make this file a .i file so future direction stuff can be
  3257. // added without worries of it being distributed...
  3258. #if forVMBackingStore
  3259.  
  3260. void    FWIMEnableVMUserCode( void );
  3261. void    FWIMDisableVMUserCode( void );
  3262.  
  3263. #else
  3264.  
  3265. #define    FWIMEnableVMUserCode()
  3266. #define    FWIMDisableVMUserCode()
  3267.  
  3268. #endif
  3269.  
  3270. //zzz Put in Devices.h
  3271.  
  3272. /* Categories */
  3273.  
  3274. enum {
  3275.     kServiceCategoryFWIM        = 'fwim',                        /* FireWire interface module */
  3276.     kServiceCategoryFWDriver    = 'fwdv'                        /* FireWire device driver */
  3277. };
  3278.  
  3279. // End - Put in Devices.h
  3280.  
  3281. //zzz Put in Errors.h
  3282.  
  3283. enum {
  3284.     inUseErr                    = -4160,                // Item already in use
  3285.     notFoundErr                    = -4161,                // Item not found
  3286.     timeoutErr                    = -4162,                // Something timed out
  3287.     busReconfiguredErr            = -4163,                // Bus was reconfigured
  3288.     insufficientBandwidthErr    = -4164,                // Not enough bandwidth was available
  3289.     invalidIDErr                = -4165,                // Given ID is not valid.
  3290.     invalidIDTypeErr            = -4166,                // Given ID is of an invalid type for the requested operation.
  3291.     accessErr                    = -4167,                // Requested access not allowed.
  3292.     alreadyRegisteredErr        = -4168,                // Item has already been registered.
  3293.     disconnectedErr                = -4169,                // Target of request has been disconnected.
  3294.     retryExceededErr            = -4170,                // Retry limit was exceeded.
  3295.     addressRangeErr                = -4171,                // Address is not in range.
  3296.     addressAlignmentErr            = -4172,                // Address is not of proper alignment.
  3297.  
  3298.     multipleTalkerErr            = -4180,                // Tried to install multiple talkers
  3299.     channelActiveErr            = -4181,                // Operation not permitted when channel is active
  3300.     noListenerOrTalkerErr        = -4182,                // Every isochronous channel must have one talker and at least
  3301.                                                         // one listener
  3302.     noChannelsAvailableErr        = -4183,                // No supported isochronous channels are available
  3303.     channelNotAvailableErr        = -4184,                // Required channel was not available.
  3304.     invalidIsochPortIDErr        = -4185,                // An isochronous port ID is invalid.
  3305.     invalidFWReferenceTypeErr    = -4186,                // Operation does not support type of given reference ID
  3306.     separateBusErr                = -4187,                // Two or more entities are on two or more busses and cannot be associated with eachother.
  3307.     badSelfIDsErr                = -4188,                // Received self IDs are bad.
  3308.  
  3309. //zzz Do we own these next ID numbers?
  3310.     cableVoltageTooLowErr        = -4190,                // Cable power below device's minimum voltage
  3311.     cablePowerInsufficientErr    = -4191                    // Can't grant power request at this time
  3312. };
  3313.  
  3314. // end - Put in Errors.h
  3315.  
  3316. #if PRAGMA_ALIGN_SUPPORTED
  3317. #pragma options align=reset
  3318. #endif
  3319.  
  3320. #if PRAGMA_IMPORT_SUPPORTED
  3321. #pragma import off
  3322. #endif
  3323.  
  3324. #ifdef __cplusplus
  3325. }
  3326. #endif
  3327.  
  3328. #endif /* __FIREWIRE__ */
  3329.